Skip to content

Commit 8b43e72

Browse files
authored
test: remove Lit tests for controllers and mixins from 24.9 (#10029)
1 parent 7343115 commit 8b43e72

37 files changed

+156
-553
lines changed

packages/a11y-base/test/active-mixin.test.js

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
11
import { expect } from '@vaadin/chai-plugins';
22
import { sendKeys } from '@vaadin/test-runner-commands';
3-
import {
4-
defineLit,
5-
definePolymer,
6-
fixtureSync,
7-
mousedown,
8-
mouseup,
9-
touchend,
10-
touchstart,
11-
} from '@vaadin/testing-helpers';
12-
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
13-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
3+
import { definePolymer, fixtureSync, mousedown, mouseup, touchend, touchstart } from '@vaadin/testing-helpers';
144
import { ActiveMixin } from '../src/active-mixin.js';
155

16-
const runTests = (defineHelper, baseMixin) => {
17-
const tag = defineHelper('active-mixin', '<slot></slot>', (Base) => class extends ActiveMixin(baseMixin(Base)) {});
6+
describe('ActiveMixin', () => {
7+
const tag = definePolymer('active-mixin', '<slot></slot>', (Base) => class extends ActiveMixin(Base) {});
188

199
let element;
2010

@@ -121,12 +111,4 @@ const runTests = (defineHelper, baseMixin) => {
121111
element.parentNode.removeChild(element);
122112
expect(element.hasAttribute('active')).to.be.false;
123113
});
124-
};
125-
126-
describe('ActiveMixin + Polymer', () => {
127-
runTests(definePolymer, ControllerMixin);
128-
});
129-
130-
describe('ActiveMixin + Lit', () => {
131-
runTests(defineLit, PolylitMixin);
132114
});

packages/a11y-base/test/aria-modal-controller.test.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import { expect } from '@vaadin/chai-plugins';
2-
import { defineLit, definePolymer, fixtureSync, nextRender } from '@vaadin/testing-helpers';
2+
import { definePolymer, fixtureSync, nextRender } from '@vaadin/testing-helpers';
33
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
4-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
54
import { AriaModalController } from '../src/aria-modal-controller.js';
65

7-
const runTests = (defineHelper, baseMixin) => {
6+
describe('AriaModalController', () => {
87
let wrapper, elements, modal, controller;
98

10-
const tag = defineHelper('aria-modal', '<slot></slot>', (Base) => class extends baseMixin(Base) {});
9+
const tag = definePolymer('aria-modal', '<slot></slot>', (Base) => class extends ControllerMixin(Base) {});
1110

1211
beforeEach(async () => {
1312
wrapper = fixtureSync(`
@@ -82,12 +81,4 @@ const runTests = (defineHelper, baseMixin) => {
8281
});
8382
});
8483
});
85-
};
86-
87-
describe('AriaModalController + Polymer', () => {
88-
runTests(definePolymer, ControllerMixin);
89-
});
90-
91-
describe('AriaModalController + Lit', () => {
92-
runTests(defineLit, PolylitMixin);
9384
});

packages/a11y-base/test/delegate-focus-mixin.test.js

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
import { expect } from '@vaadin/chai-plugins';
2-
import { defineLit, definePolymer, fixtureSync, focusin, focusout, nextFrame } from '@vaadin/testing-helpers';
2+
import { definePolymer, fixtureSync, focusin, focusout, nextFrame } from '@vaadin/testing-helpers';
33
import sinon from 'sinon';
4-
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
5-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
64
import { DelegateFocusMixin } from '../src/delegate-focus-mixin.js';
75

8-
const runTests = (defineHelper, baseMixin) => {
6+
describe('DelegateFocusMixin', () => {
97
let setFocusedSpy;
108

11-
const tag = defineHelper(
9+
const tag = definePolymer(
1210
'delegate-focus-mixin',
1311
`
1412
<slot name="input"></slot>
1513
<slot name="suffix"></slot>
1614
`,
1715
(Base) =>
18-
class extends DelegateFocusMixin(baseMixin(Base)) {
16+
class extends DelegateFocusMixin(Base) {
1917
ready() {
2018
super.ready();
2119
const input = this.querySelector('input');
@@ -306,12 +304,4 @@ const runTests = (defineHelper, baseMixin) => {
306304
});
307305
});
308306
});
309-
};
310-
311-
describe('DelegateFocusMixin + Polymer', () => {
312-
runTests(definePolymer, ControllerMixin);
313-
});
314-
315-
describe('DelegateFocusMixin + Lit', () => {
316-
runTests(defineLit, PolylitMixin);
317307
});

packages/a11y-base/test/disabled-mixin.test.js

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
import { expect } from '@vaadin/chai-plugins';
2-
import { defineLit, definePolymer, fixtureSync, nextRender } from '@vaadin/testing-helpers';
2+
import { definePolymer, fixtureSync, nextRender } from '@vaadin/testing-helpers';
33
import sinon from 'sinon';
4-
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
5-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
64
import { DisabledMixin } from '../src/disabled-mixin.js';
75

8-
const runTests = (defineHelper, baseMixin) => {
9-
const tag = defineHelper(
10-
'disabled-mixin',
11-
'<slot></slot>',
12-
(Base) => class extends DisabledMixin(baseMixin(Base)) {},
13-
);
6+
describe('DisabledMixin', () => {
7+
const tag = definePolymer('disabled-mixin', '<slot></slot>', (Base) => class extends DisabledMixin(Base) {});
148

159
let element;
1610

@@ -46,12 +40,4 @@ const runTests = (defineHelper, baseMixin) => {
4640
element.click();
4741
expect(spy.called).to.be.false;
4842
});
49-
};
50-
51-
describe('DisabledMixin + Polymer', () => {
52-
runTests(definePolymer, ControllerMixin);
53-
});
54-
55-
describe('DisabledMixin + Lit', () => {
56-
runTests(defineLit, PolylitMixin);
5743
});

packages/a11y-base/test/field-aria-controller.test.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { expect } from '@vaadin/chai-plugins';
2-
import { defineLit, definePolymer, fixtureSync, nextRender } from '@vaadin/testing-helpers';
2+
import { definePolymer, fixtureSync, nextRender } from '@vaadin/testing-helpers';
33
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
4-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
54
import { FieldAriaController } from '../src/field-aria-controller.js';
65

7-
const runTests = (defineHelper, baseMixin) => {
8-
const tag = defineHelper('field-aria', '<slot></slot>', (Base) => class extends baseMixin(Base) {});
6+
describe('FieldAriaController', () => {
7+
const tag = definePolymer('field-aria', '<slot></slot>', (Base) => class extends ControllerMixin(Base) {});
98

109
let element, input, controller;
1110

@@ -216,12 +215,4 @@ const runTests = (defineHelper, baseMixin) => {
216215
});
217216
});
218217
});
219-
};
220-
221-
describe('FieldAriaController + Polymer', () => {
222-
runTests(definePolymer, ControllerMixin);
223-
});
224-
225-
describe('FieldAriaController + Lit', () => {
226-
runTests(defineLit, PolylitMixin);
227218
});

packages/a11y-base/test/focus-mixin.test.js

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
import { expect } from '@vaadin/chai-plugins';
2-
import {
3-
defineLit,
4-
definePolymer,
5-
fixtureSync,
6-
focusin,
7-
focusout,
8-
keyDownOn,
9-
mousedown,
10-
} from '@vaadin/testing-helpers';
11-
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
12-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
2+
import { definePolymer, fixtureSync, focusin, focusout, keyDownOn, mousedown } from '@vaadin/testing-helpers';
133
import { FocusMixin } from '../src/focus-mixin.js';
144

15-
const runTests = (defineHelper, baseMixin) => {
16-
const tag = defineHelper(
5+
describe('FocusMixin', () => {
6+
const tag = definePolymer(
177
'focus-mixin',
188
'<slot></slot>',
199
(Base) =>
20-
class extends FocusMixin(baseMixin(Base)) {
10+
class extends FocusMixin(Base) {
2111
ready() {
2212
super.ready();
2313
const input = document.createElement('input');
@@ -65,12 +55,4 @@ const runTests = (defineHelper, baseMixin) => {
6555
focusin(input);
6656
expect(element.hasAttribute('focus-ring')).to.be.false;
6757
});
68-
};
69-
70-
describe('FocusMixin + Polymer', () => {
71-
runTests(definePolymer, ControllerMixin);
72-
});
73-
74-
describe('FocusMixin + Lit', () => {
75-
runTests(defineLit, PolylitMixin);
7658
});

packages/a11y-base/test/focus-trap-controller.test.js

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { expect } from '@vaadin/chai-plugins';
22
import { sendKeys } from '@vaadin/test-runner-commands';
3-
import { defineLit, definePolymer, fixtureSync } from '@vaadin/testing-helpers';
3+
import { definePolymer, fixtureSync } from '@vaadin/testing-helpers';
44
import sinon from 'sinon';
55
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
6-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
76
import { FocusTrapController } from '../src/focus-trap-controller.js';
87

98
async function tab() {
@@ -16,12 +15,12 @@ async function shiftTab() {
1615
return document.activeElement;
1716
}
1817

19-
const runTests = (defineHelper, baseMixin) => {
20-
const tag = defineHelper(
18+
describe('FocusTrapController', () => {
19+
const tag = definePolymer(
2120
'focus-trap',
2221
'<slot></slot>',
2322
(Base) =>
24-
class extends baseMixin(Base) {
23+
class extends ControllerMixin(Base) {
2524
ready() {
2625
super.ready();
2726
this.innerHTML = `
@@ -43,11 +42,11 @@ const runTests = (defineHelper, baseMixin) => {
4342
},
4443
);
4544

46-
const wrapperTag = defineHelper(
45+
const wrapperTag = definePolymer(
4746
'focus-trap-wrapper',
4847
'<slot></slot>',
4948
(Base) =>
50-
class extends baseMixin(Base) {
49+
class extends ControllerMixin(Base) {
5150
ready() {
5251
super.ready();
5352
this.innerHTML = `
@@ -352,12 +351,4 @@ const runTests = (defineHelper, baseMixin) => {
352351
expect(document.activeElement).to.equal(trapInput1);
353352
});
354353
});
355-
};
356-
357-
describe('FocusTrapController + Polymer', () => {
358-
runTests(definePolymer, ControllerMixin);
359-
});
360-
361-
describe('FocusTrapController + Lit', () => {
362-
runTests(defineLit, PolylitMixin);
363354
});

packages/a11y-base/test/keyboard-direction-mixin.test.js

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
arrowLeftKeyDown,
55
arrowRightKeyDown,
66
arrowUpKeyDown,
7-
defineLit,
87
definePolymer,
98
endKeyDown,
109
fixtureSync,
@@ -13,11 +12,10 @@ import {
1312
} from '@vaadin/testing-helpers';
1413
import sinon from 'sinon';
1514
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
16-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
1715
import { KeyboardDirectionMixin } from '../src/keyboard-direction-mixin.js';
1816

19-
const runTests = (defineHelper, baseMixin) => {
20-
const tag = defineHelper(
17+
describe('KeyboardDirectionMixin', () => {
18+
const tag = definePolymer(
2119
'keyboard-direction-mixin',
2220
`
2321
<style>
@@ -32,7 +30,7 @@ const runTests = (defineHelper, baseMixin) => {
3230
<slot></slot>
3331
`,
3432
(Base) =>
35-
class extends KeyboardDirectionMixin(baseMixin(Base)) {
33+
class extends KeyboardDirectionMixin(ControllerMixin(Base)) {
3634
get _vertical() {
3735
return this.hasAttribute('vertical');
3836
}
@@ -246,12 +244,4 @@ const runTests = (defineHelper, baseMixin) => {
246244
expect(element.focused).to.not.equal(items[0]);
247245
});
248246
});
249-
};
250-
251-
describe('KeyboardDirectionMixin + Polymer', () => {
252-
runTests(definePolymer, ControllerMixin);
253-
});
254-
255-
describe('KeyboardDirectionMixin + Lit', () => {
256-
runTests(defineLit, PolylitMixin);
257247
});

packages/a11y-base/test/keyboard-mixin.test.js

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
import { expect } from '@vaadin/chai-plugins';
22
import { sendKeys } from '@vaadin/test-runner-commands';
3-
import { defineLit, definePolymer, fixtureSync } from '@vaadin/testing-helpers';
3+
import { definePolymer, fixtureSync } from '@vaadin/testing-helpers';
44
import sinon from 'sinon';
5-
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
6-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
75
import { KeyboardMixin } from '../src/keyboard-mixin.js';
86

9-
const runTests = (defineHelper, baseMixin) => {
7+
describe('KeyboardMixin', () => {
108
let element, enterSpy, escapeSpy, keyDownSpy, keyUpSpy;
119

12-
const tag = defineHelper(
10+
const tag = definePolymer(
1311
'keyboard-mixin',
1412
'<slot></slot>',
1513
(Base) =>
16-
class extends KeyboardMixin(baseMixin(Base)) {
14+
class extends KeyboardMixin(Base) {
1715
_onKeyDown(event) {
1816
super._onKeyDown(event);
1917

@@ -83,12 +81,4 @@ const runTests = (defineHelper, baseMixin) => {
8381
expect(enterSpy.args[0][0]).to.be.an.instanceOf(KeyboardEvent);
8482
expect(enterSpy.args[0][0].type).to.equal('keydown');
8583
});
86-
};
87-
88-
describe('KeyboardMixin + Polymer', () => {
89-
runTests(definePolymer, ControllerMixin);
90-
});
91-
92-
describe('KeyboardMixin + Lit', () => {
93-
runTests(defineLit, PolylitMixin);
9484
});

0 commit comments

Comments
 (0)