Skip to content

Commit

Permalink
test: split combo-box tests into common and import files (#7185)
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan authored Mar 8, 2024
1 parent 2d79785 commit 13e5de2
Show file tree
Hide file tree
Showing 39 changed files with 69 additions and 47 deletions.
3 changes: 3 additions & 0 deletions packages/combo-box/test/aria-polymer.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import './not-animated-styles.js';
import '../src/vaadin-combo-box.js';
import './aria.common.js';
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { expect } from '@esm-bundle/chai';
import { arrowDownKeyDown, escKeyDown, fixtureSync, nextFrame, nextRender } from '@vaadin/testing-helpers';
import './not-animated-styles.js';
import '../vaadin-combo-box.js';
import { getAllItems } from './helpers.js';

describe('ARIA', () => {
Expand Down
3 changes: 3 additions & 0 deletions packages/combo-box/test/basic-polymer.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import './not-animated-styles.js';
import '../vaadin-combo-box.js';
import './basic.common.js';
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { expect } from '@esm-bundle/chai';
import { fixtureSync, nextRender, outsideClick } from '@vaadin/testing-helpers';
import sinon from 'sinon';
import './not-animated-styles.js';
import '../vaadin-combo-box.js';
import { getViewportItems, setInputValue } from './helpers.js';

describe('basic features', () => {
Expand Down
3 changes: 3 additions & 0 deletions packages/combo-box/test/combo-box-light-polymer.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import './not-animated-styles.js';
import '../vaadin-combo-box-light.js';
import './combo-box-light.common.js';
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import './not-animated-styles.js';
import '../vaadin-combo-box-light.js';
import './combo-box-light-validation.common.js';
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { expect } from '@esm-bundle/chai';
import { fixtureSync, nextRender } from '@vaadin/testing-helpers';
import { sendKeys } from '@web/test-runner-commands';
import sinon from 'sinon';
import './not-animated-styles.js';
import '../vaadin-combo-box-light.js';

describe('vaadin-combo-box-light - validation', () => {
let comboBox, input;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import {
import { sendKeys } from '@web/test-runner-commands';
import sinon from 'sinon';
import '@vaadin/text-field/vaadin-text-field.js';
import './not-animated-styles.js';
import '../vaadin-combo-box-light.js';
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
import { isTouch } from '@vaadin/component-base/src/browser-utils.js';
import { getFirstItem } from './helpers.js';
Expand Down
2 changes: 2 additions & 0 deletions packages/combo-box/test/dynamic-size-polymer.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import '../src/vaadin-combo-box.js';
import './dynamic-size.common.js';
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { expect } from '@esm-bundle/chai';
import { fixtureSync, nextFrame, nextRender } from '@vaadin/testing-helpers';
import '../src/vaadin-combo-box.js';
import { flushComboBox, getViewportItems, scrollToIndex } from './helpers.js';

describe('dynamic size change', () => {
Expand Down
3 changes: 3 additions & 0 deletions packages/combo-box/test/events-polymer.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import './not-animated-styles.js';
import '../vaadin-combo-box.js';
import './events.common.js';
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { expect } from '@esm-bundle/chai';
import { fixtureSync, focusout, nextRender, outsideClick } from '@vaadin/testing-helpers';
import sinon from 'sinon';
import './not-animated-styles.js';
import '../vaadin-combo-box.js';
import { clickItem, setInputValue } from './helpers.js';

describe('events', () => {
Expand Down
3 changes: 3 additions & 0 deletions packages/combo-box/test/external-filtering-polymer.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import './not-animated-styles.js';
import '../vaadin-combo-box.js';
import './external-filtering.common.js';
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { expect } from '@esm-bundle/chai';
import { aTimeout, enter, fixtureSync, nextRender } from '@vaadin/testing-helpers';
import './not-animated-styles.js';
import '../vaadin-combo-box.js';
import { getFocusedItemIndex, setInputValue } from './helpers.js';

describe('external filtering', () => {
Expand Down
3 changes: 3 additions & 0 deletions packages/combo-box/test/interactions-polymer.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import './not-animated-styles.js';
import '../vaadin-combo-box.js';
import './interactions.common.js';
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import {
} from '@vaadin/testing-helpers';
import { sendKeys } from '@web/test-runner-commands';
import sinon from 'sinon';
import './not-animated-styles.js';
import '../vaadin-combo-box.js';
import { isTouch } from '@vaadin/component-base/src/browser-utils.js';
import { getFirstItem, setInputValue } from './helpers.js';

Expand Down
3 changes: 3 additions & 0 deletions packages/combo-box/test/internal-filtering-polymer.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import './not-animated-styles.js';
import '../vaadin-combo-box.js';
import './internal-filtering.common.js';
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { expect } from '@esm-bundle/chai';
import { fixtureSync, nextRender, outsideClick } from '@vaadin/testing-helpers';
import sinon from 'sinon';
import './not-animated-styles.js';
import '../vaadin-combo-box.js';
import { ComboBoxPlaceholder } from '../src/vaadin-combo-box-placeholder.js';
import { getAllItems, getFocusedItemIndex, makeItems, onceOpened, setInputValue } from './helpers.js';

Expand Down
3 changes: 3 additions & 0 deletions packages/combo-box/test/item-renderer-polymer.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import './not-animated-styles.js';
import '../vaadin-combo-box.js';
import './item-renderer.common.js';
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { expect } from '@esm-bundle/chai';
import { fixtureSync, nextRender } from '@vaadin/testing-helpers';
import sinon from 'sinon';
import './not-animated-styles.js';
import '../vaadin-combo-box.js';
import { getAllItems, getFirstItem, setInputValue } from './helpers.js';

describe('item renderer', () => {
Expand Down
3 changes: 3 additions & 0 deletions packages/combo-box/test/keyboard-polymer.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import './not-animated-styles.js';
import '../src/vaadin-combo-box.js';
import './keyboard.common.js';
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
} from '@vaadin/testing-helpers';
import { sendKeys } from '@web/test-runner-commands';
import sinon from 'sinon';
import '../src/vaadin-combo-box.js';
import { getViewportItems, getVisibleItemsCount, scrollToIndex, setInputValue } from './helpers.js';

describe('keyboard', () => {
Expand Down
6 changes: 6 additions & 0 deletions packages/combo-box/test/lazy-loading-polymer.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import './not-animated-styles.js';
import './lazy-loading-styles.js';
import '@vaadin/text-field/vaadin-text-field.js';
import '../vaadin-combo-box-light.js';
import '../vaadin-combo-box.js';
import './lazy-loading.common.js';
10 changes: 10 additions & 0 deletions packages/combo-box/test/lazy-loading-styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';

registerStyles(
'vaadin-combo-box*',
css`
:host {
--vaadin-combo-box-overlay-max-height: 400px;
}
`,
);
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { expect } from '@esm-bundle/chai';
import { arrowDownKeyDown, aTimeout, enterKeyDown, fixtureSync, nextFrame, nextRender } from '@vaadin/testing-helpers';
import sinon from 'sinon';
import '@vaadin/text-field/vaadin-text-field.js';
import './not-animated-styles.js';
import '../vaadin-combo-box.js';
import '../vaadin-combo-box-light.js';
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
import { ComboBoxPlaceholder } from '../src/vaadin-combo-box-placeholder.js';
import {
clickItem,
Expand All @@ -21,15 +16,6 @@ import {
setInputValue,
} from './helpers.js';

registerStyles(
'vaadin-combo-box*',
css`
:host {
--vaadin-combo-box-overlay-max-height: 400px;
}
`,
);

describe('lazy loading', () => {
const DEFAULT_PAGE_SIZE = 50;
const SIZE = 200;
Expand Down
3 changes: 3 additions & 0 deletions packages/combo-box/test/lit-polymer.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import './not-animated-styles.js';
import '../vaadin-combo-box.js';
import './lit.common.js';
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import './not-animated-styles.js';
import '../vaadin-combo-box.js';
import './lit-renderer-directives.common.js';
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { expect } from '@esm-bundle/chai';
import { fixtureSync, nextFrame } from '@vaadin/testing-helpers';
import sinon from 'sinon';
import '../vaadin-combo-box.js';
import { html, render } from 'lit';
import { comboBoxRenderer } from '../lit.js';
import { getAllItems } from './helpers.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { expect } from '@esm-bundle/chai';
import { fixtureSync, nextFrame } from '@vaadin/testing-helpers';
import './not-animated-styles.js';
import '../vaadin-combo-box.js';
import { html, LitElement, render } from 'lit';
import { getViewportItems } from './helpers.js';

Expand Down
3 changes: 3 additions & 0 deletions packages/combo-box/test/object-values-polymer.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import './not-animated-styles.js';
import '../src/vaadin-combo-box.js';
import './object-values.common.js';
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { expect } from '@esm-bundle/chai';
import { fixtureSync, nextRender } from '@vaadin/testing-helpers';
import sinon from 'sinon';
import './not-animated-styles.js';
import '../vaadin-combo-box.js';
import { clickItem, getFirstItem, getViewportItems } from './helpers.js';

describe('object values', () => {
Expand Down
3 changes: 3 additions & 0 deletions packages/combo-box/test/overlay-opening-polymer.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import './not-animated-styles.js';
import '../vaadin-combo-box.js';
import './overlay-opening.common.js';
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { expect } from '@esm-bundle/chai';
import { arrowDownKeyDown, arrowUpKeyDown, click, fixtureSync, nextRender } from '@vaadin/testing-helpers';
import './not-animated-styles.js';
import '../vaadin-combo-box.js';
import { setInputValue } from './helpers.js';

describe('overlay opening', () => {
Expand Down
3 changes: 3 additions & 0 deletions packages/combo-box/test/overlay-position-polymer.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import './not-animated-styles.js';
import '../vaadin-combo-box.js';
import './overlay-position.common.js';
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { expect } from '@esm-bundle/chai';
import { aTimeout, fixtureSync } from '@vaadin/testing-helpers';
import '../vaadin-combo-box.js';
import './not-animated-styles.js';
import { makeItems, setInputValue } from './helpers.js';

describe('overlay position', () => {
Expand Down
3 changes: 3 additions & 0 deletions packages/combo-box/test/selecting-items-polymer.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import './not-animated-styles.js';
import '../vaadin-combo-box.js';
import './selecting-items.common.js';
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { expect } from '@esm-bundle/chai';
import { aTimeout, fire, fixtureSync, nextRender, outsideClick } from '@vaadin/testing-helpers';
import sinon from 'sinon';
import './not-animated-styles.js';
import '../vaadin-combo-box.js';
import { clickItem, getAllItems, getFirstItem, onceScrolled, scrollToIndex, setInputValue } from './helpers.js';

describe('selecting items', () => {
Expand Down
3 changes: 3 additions & 0 deletions packages/combo-box/test/validation-polymer.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import './not-animated-styles.js';
import '../vaadin-combo-box.js';
import './validation.common.js';
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { expect } from '@esm-bundle/chai';
import { fixtureSync, nextRender, outsideClick } from '@vaadin/testing-helpers';
import { sendKeys } from '@web/test-runner-commands';
import sinon from 'sinon';
import './not-animated-styles.js';
import '../vaadin-combo-box.js';

describe('validation', () => {
let comboBox, input;
Expand Down

0 comments on commit 13e5de2

Please sign in to comment.