Skip to content

Commit 70be3ed

Browse files
authored
test: update multi-select-combo-box tests to use src version (#8968)
1 parent e3b3777 commit 70be3ed

7 files changed

Lines changed: 76 additions & 13 deletions

File tree

‎packages/multi-select-combo-box/test/accessibility.test.js‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import { expect } from '@vaadin/chai-plugins';
22
import { sendKeys } from '@vaadin/test-runner-commands';
33
import { fixtureSync, nextRender } from '@vaadin/testing-helpers';
44
import sinon from 'sinon';
5-
import './not-animated-styles.js';
6-
import '../vaadin-multi-select-combo-box.js';
5+
import '../src/vaadin-multi-select-combo-box.js';
76

87
describe('accessibility', () => {
98
let comboBox, inputElement;

‎packages/multi-select-combo-box/test/chips.test.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { expect } from '@vaadin/chai-plugins';
22
import { sendKeys } from '@vaadin/test-runner-commands';
33
import { fixtureSync, nextRender, nextResize, nextUpdate } from '@vaadin/testing-helpers';
4-
import './not-animated-styles.js';
5-
import '../vaadin-multi-select-combo-box.js';
4+
import './multi-select-combo-box-test-styles.js';
5+
import '../src/vaadin-multi-select-combo-box.js';
66

77
describe('chips', () => {
88
let comboBox, inputElement;
@@ -181,7 +181,7 @@ describe('chips', () => {
181181
});
182182

183183
it('should update overflow chip on clear button state change', async () => {
184-
comboBox.style.width = '350px';
184+
comboBox.style.width = '340px';
185185
await nextResize(comboBox);
186186

187187
comboBox.clearButtonVisible = true;

‎packages/multi-select-combo-box/test/lit-renderer-directives.test.js‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { expect } from '@vaadin/chai-plugins';
22
import { fixtureSync, nextFrame } from '@vaadin/testing-helpers';
33
import sinon from 'sinon';
4-
import './not-animated-styles.js';
5-
import '../vaadin-multi-select-combo-box.js';
4+
import '../src/vaadin-multi-select-combo-box.js';
65
import { html, render } from 'lit';
76
import { flushComboBox } from '@vaadin/combo-box/test/helpers.js';
87
import { multiSelectComboBoxRenderer } from '../lit.js';
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
2+
3+
// TODO: subset of Lumo needed for unit tests to pass.
4+
// These should be eventually covered by base styles.
5+
registerStyles(
6+
'vaadin-multi-select-combo-box',
7+
css`
8+
::slotted([slot='chip']),
9+
::slotted([slot='overflow']) {
10+
padding: 0.3125em 0.5625em;
11+
}
12+
13+
::slotted([slot='chip']:not(:last-of-type)),
14+
::slotted([slot='overflow']:not(:last-of-type)) {
15+
margin-inline-end: 0.25rem;
16+
}
17+
18+
::slotted([slot='chip']:not([readonly]):not([disabled])) {
19+
padding-inline-end: 0;
20+
}
21+
22+
::slotted(input) {
23+
padding: 0 0.25em;
24+
}
25+
26+
[part$='button'] {
27+
flex: none;
28+
font-size: 1.5em;
29+
width: 1em;
30+
height: 1em;
31+
}
32+
33+
[part$='button']::before {
34+
display: block;
35+
height: 100%;
36+
}
37+
`,
38+
);
39+
40+
registerStyles(
41+
'vaadin-multi-select-combo-box-container',
42+
css`
43+
:host {
44+
padding: 0 6px;
45+
}
46+
`,
47+
);
48+
49+
registerStyles(
50+
'vaadin-multi-select-combo-box-chip',
51+
css`
52+
:host {
53+
font-family: -apple-system, 'system-ui', Roboto, 'Segoe UI', Helvetica, Arial, sans-serif;
54+
font-size: 0.75rem;
55+
}
56+
57+
[part='label'] {
58+
font-weight: 500;
59+
}
60+
61+
[part='remove-button'] {
62+
display: flex;
63+
width: 1.25em;
64+
height: 1.25em;
65+
font-size: 1.5em;
66+
}
67+
`,
68+
);

‎packages/multi-select-combo-box/test/readonly.test.js‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import { expect } from '@vaadin/chai-plugins';
22
import { sendKeys } from '@vaadin/test-runner-commands';
33
import { aTimeout, fixtureSync, nextRender } from '@vaadin/testing-helpers';
44
import sinon from 'sinon';
5-
import './not-animated-styles.js';
6-
import '../vaadin-multi-select-combo-box.js';
5+
import '../src/vaadin-multi-select-combo-box.js';
76
import { getAsyncDataProvider } from './helpers.js';
87

98
describe('readonly', () => {

‎packages/multi-select-combo-box/test/selecting-items.test.js‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import { expect } from '@vaadin/chai-plugins';
22
import { resetMouse, sendKeys, sendMouse } from '@vaadin/test-runner-commands';
33
import { fixtureSync, keyboardEventFor, nextRender } from '@vaadin/testing-helpers';
44
import sinon from 'sinon';
5-
import './not-animated-styles.js';
6-
import '../vaadin-multi-select-combo-box.js';
5+
import '../src/vaadin-multi-select-combo-box.js';
76
import { getAllItems, getDataProvider, getFirstItem } from './helpers.js';
87

98
describe('selecting items', () => {

‎packages/multi-select-combo-box/test/validation.test.js‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import { expect } from '@vaadin/chai-plugins';
22
import { sendKeys } from '@vaadin/test-runner-commands';
33
import { fixtureSync, nextRender, outsideClick } from '@vaadin/testing-helpers';
44
import sinon from 'sinon';
5-
import './not-animated-styles.js';
6-
import '../vaadin-multi-select-combo-box.js';
5+
import '../src/vaadin-multi-select-combo-box.js';
76

87
describe('validation', () => {
98
let comboBox, validateSpy, changeSpy, input;

0 commit comments

Comments
 (0)