@crowdstrike/glide-core 0.12.1 → 0.12.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/checkbox-group.styles.js +1 -1
  2. package/dist/dropdown.d.ts +5 -1
  3. package/dist/dropdown.js +126 -58
  4. package/dist/dropdown.option.d.ts +3 -0
  5. package/dist/dropdown.option.js +1 -1
  6. package/dist/dropdown.option.styles.js +81 -16
  7. package/dist/dropdown.option.test.basics.js +4 -33
  8. package/dist/dropdown.option.test.basics.multiple.js +9 -0
  9. package/dist/dropdown.option.test.basics.single.js +8 -0
  10. package/dist/dropdown.option.test.interactions.multiple.js +12 -0
  11. package/dist/dropdown.option.test.interactions.single.js +11 -0
  12. package/dist/dropdown.styles.js +127 -29
  13. package/dist/dropdown.test.basics.filterable.js +11 -54
  14. package/dist/dropdown.test.basics.js +24 -244
  15. package/dist/dropdown.test.basics.multiple.js +13 -60
  16. package/dist/dropdown.test.basics.single.js +2 -8
  17. package/dist/dropdown.test.events.filterable.js +12 -54
  18. package/dist/dropdown.test.events.js +139 -46
  19. package/dist/dropdown.test.events.multiple.js +17 -87
  20. package/dist/dropdown.test.events.single.js +99 -60
  21. package/dist/dropdown.test.focus.filterable.js +13 -60
  22. package/dist/dropdown.test.focus.js +64 -11
  23. package/dist/dropdown.test.focus.multiple.js +36 -46
  24. package/dist/dropdown.test.focus.single.js +28 -23
  25. package/dist/dropdown.test.form.js +22 -0
  26. package/dist/dropdown.test.interactions.filterable.js +86 -72
  27. package/dist/dropdown.test.interactions.js +361 -207
  28. package/dist/dropdown.test.interactions.multiple.js +152 -279
  29. package/dist/dropdown.test.interactions.single.js +62 -98
  30. package/dist/dropdown.test.validity.js +12 -49
  31. package/dist/icons/pencil.d.ts +2 -0
  32. package/dist/icons/pencil.js +1 -0
  33. package/dist/label.js +1 -1
  34. package/dist/label.styles.js +7 -3
  35. package/dist/library/localize.d.ts +2 -0
  36. package/dist/menu.js +1 -1
  37. package/dist/menu.options.js +1 -1
  38. package/dist/menu.options.test.events.d.ts +1 -0
  39. package/dist/menu.options.test.events.js +19 -0
  40. package/dist/menu.test.interactions.d.ts +1 -0
  41. package/dist/menu.test.interactions.js +38 -0
  42. package/dist/radio-group.styles.js +1 -1
  43. package/dist/tab.group.d.ts +8 -1
  44. package/dist/tab.group.js +1 -1
  45. package/dist/tab.group.styles.js +4 -0
  46. package/dist/tab.group.test.basics.js +77 -1
  47. package/dist/tab.panel.js +1 -1
  48. package/dist/tab.panel.styles.js +15 -0
  49. package/dist/tag.d.ts +2 -0
  50. package/dist/tag.js +1 -1
  51. package/dist/tag.styles.js +46 -5
  52. package/dist/tag.test.basics.js +1 -1
  53. package/dist/tag.test.events.js +76 -3
  54. package/dist/tag.test.focus.js +1 -1
  55. package/dist/textarea.styles.js +1 -1
  56. package/dist/translations/en.js +1 -1
  57. package/dist/translations/fr.d.ts +1 -1
  58. package/dist/translations/fr.js +1 -1
  59. package/dist/translations/ja.d.ts +1 -1
  60. package/dist/translations/ja.js +1 -1
  61. package/package.json +1 -1
@@ -27,10 +27,7 @@ it('has defaults', async () => {
27
27
  // idea is that this test shouldn't fail to typecheck if these templates are
28
28
  // eventually typechecked, which means supplying all required attributes and slots.
29
29
  const component = await fixture(html `<glide-core-dropdown label="Label" placeholder="Placeholder">
30
- <glide-core-dropdown-option
31
- label="Label"
32
- value="value"
33
- ></glide-core-dropdown-option>
30
+ <glide-core-dropdown-option label="Label"></glide-core-dropdown-option>
34
31
  </glide-core-dropdown>`);
35
32
  expect(component.disabled).to.be.false;
36
33
  expect(component.filterable).to.be.false;
@@ -44,7 +41,6 @@ it('can be open', async () => {
44
41
  const component = await fixture(html `<glide-core-dropdown label="Label" placeholder="Placeholder" open>
45
42
  <glide-core-dropdown-option
46
43
  label="Label"
47
- value="value"
48
44
  selected
49
45
  ></glide-core-dropdown-option>
50
46
  </glide-core-dropdown>`);
@@ -62,10 +58,7 @@ it('cannot be open when disabled', async () => {
62
58
  open
63
59
  disabled
64
60
  >
65
- <glide-core-dropdown-option
66
- label="Label"
67
- value="value"
68
- ></glide-core-dropdown-option>
61
+ <glide-core-dropdown-option label="Label"></glide-core-dropdown-option>
69
62
  </glide-core-dropdown>`);
70
63
  const options = component?.shadowRoot?.querySelector('[data-test="options"]');
71
64
  expect(options?.checkVisibility()).to.be.false;
@@ -81,143 +74,10 @@ it('can be filterable', async () => {
81
74
  const input = component.shadowRoot?.querySelector('[data-test="input"]');
82
75
  expect(input?.checkVisibility()).to.be.true;
83
76
  });
84
- it('can have a label', async () => {
85
- const component = await fixture(html `<glide-core-dropdown label="Label" placeholder="Placeholder">
86
- <glide-core-dropdown-option
87
- label="Label"
88
- value="value"
89
- ></glide-core-dropdown-option>
90
- </glide-core-dropdown>`);
91
- expect(component.getAttribute('label')).to.equal('Label');
92
- expect(component.label).to.equal('Label');
93
- });
94
- it('can have a placeholder', async () => {
95
- const component = await fixture(html `<glide-core-dropdown label="Label" placeholder="Placeholder">
96
- <glide-core-dropdown-option
97
- label="Label"
98
- value="value"
99
- ></glide-core-dropdown-option>
100
- </glide-core-dropdown>`);
101
- expect(component.getAttribute('placeholder')).to.equal('Placeholder');
102
- expect(component.placeholder).to.equal('Placeholder');
103
- });
104
- it('can have a description', async () => {
105
- const component = await fixture(html `<glide-core-dropdown label="Label" placeholder="Placeholder">
106
- <div slot="description">Description</div>
107
- <glide-core-dropdown-option
108
- label="Label"
109
- value="value"
110
- ></glide-core-dropdown-option>
111
- </glide-core-dropdown>`);
112
- const assignedElements = component.shadowRoot
113
- ?.querySelector('slot[name="description"]')
114
- ?.assignedElements();
115
- expect(assignedElements?.at(0)?.textContent).to.equal('Description');
116
- });
117
- it('can have a tooltip', async () => {
118
- const component = await fixture(html `<glide-core-dropdown label="Label" placeholder="Placeholder">
119
- <glide-core-dropdown-option
120
- label="Label"
121
- value="value"
122
- ></glide-core-dropdown-option>
123
- <div slot="tooltip">Tooltip</div>
124
- </glide-core-dropdown>`);
125
- const assignedElements = component.shadowRoot
126
- ?.querySelector('slot[name="tooltip"]')
127
- ?.assignedElements();
128
- expect(assignedElements?.at(0)?.textContent).to.equal('Tooltip');
129
- });
130
- it('can have a `name`', async () => {
131
- const component = await fixture(html `<glide-core-dropdown
132
- label="Label"
133
- placeholder="Placeholder"
134
- name="name"
135
- >
136
- <glide-core-dropdown-option
137
- label="Label"
138
- value="value"
139
- ></glide-core-dropdown-option>
140
- </glide-core-dropdown>`);
141
- expect(component.getAttribute('name')).to.equal('name');
142
- expect(component.name).to.equal('name');
143
- });
144
- it('can have a `size`', async () => {
145
- const component = await fixture(html `<glide-core-dropdown
146
- label="Label"
147
- placeholder="Placeholder"
148
- size="small"
149
- >
150
- <glide-core-dropdown-option
151
- label="Label"
152
- value="value"
153
- ></glide-core-dropdown-option>
154
- </glide-core-dropdown>`);
155
- expect(component.getAttribute('size')).to.equal('small');
156
- expect(component.size).to.equal('small');
157
- const option = component.querySelector('glide-core-dropdown-option');
158
- expect(option?.privateSize).to.equal('small');
159
- });
160
- it('can be `disabled`', async () => {
161
- const component = await fixture(html `<glide-core-dropdown label="Label" placeholder="Placeholder" disabled>
162
- <glide-core-dropdown-option
163
- label="Label"
164
- value="value"
165
- ></glide-core-dropdown-option>
166
- </glide-core-dropdown>`);
167
- expect(component.hasAttribute('disabled')).to.be.true;
168
- expect(component.disabled).to.be.true;
169
- });
170
- it('can be `required`', async () => {
171
- const component = await fixture(html `<glide-core-dropdown label="Label" placeholder="Placeholder" required>
172
- <glide-core-dropdown-option
173
- label="Label"
174
- value="value"
175
- ></glide-core-dropdown-option>
176
- </glide-core-dropdown>`);
177
- expect(component.hasAttribute('required')).to.be.true;
178
- expect(component.required).to.be.true;
179
- });
180
- it('can be `multiple`', async () => {
181
- const component = await fixture(html `<glide-core-dropdown label="Label" placeholder="Placeholder" multiple>
182
- <glide-core-dropdown-option
183
- label="One"
184
- value="one"
185
- ></glide-core-dropdown-option>
186
-
187
- <glide-core-dropdown-option
188
- label="Two"
189
- value="two"
190
- ></glide-core-dropdown-option>
191
- </glide-core-dropdown>`);
192
- expect(component.hasAttribute('multiple')).to.be.true;
193
- expect(component.multiple).to.be.true;
194
- });
195
- it('can be `select-all`', async () => {
196
- const component = await fixture(html `<glide-core-dropdown
197
- label="Label"
198
- placeholder="Placeholder"
199
- multiple
200
- select-all
201
- >
202
- <glide-core-dropdown-option
203
- label="Label"
204
- value="value"
205
- ></glide-core-dropdown-option>
206
- </glide-core-dropdown>`);
207
- expect(component.hasAttribute('select-all')).to.be.true;
208
- expect(component.selectAll).to.be.true;
209
- });
210
77
  it('activates the first option when no options are initially selected', async () => {
211
78
  const component = await fixture(html `<glide-core-dropdown open>
212
- <glide-core-dropdown-option
213
- label="One"
214
- value="one"
215
- ></glide-core-dropdown-option>
216
-
217
- <glide-core-dropdown-option
218
- label="Two"
219
- value="two"
220
- ></glide-core-dropdown-option>
79
+ <glide-core-dropdown-option label="One"></glide-core-dropdown-option>
80
+ <glide-core-dropdown-option label="Two"></glide-core-dropdown-option>
221
81
  </glide-core-dropdown>`);
222
82
  const options = component.querySelectorAll('glide-core-dropdown-option');
223
83
  expect(options[0]?.privateActive).to.be.true;
@@ -225,20 +85,15 @@ it('activates the first option when no options are initially selected', async ()
225
85
  });
226
86
  it('activates the last selected option when options are initially selected', async () => {
227
87
  const component = await fixture(html `<glide-core-dropdown open>
228
- <glide-core-dropdown-option
229
- label="One"
230
- value="one"
231
- ></glide-core-dropdown-option>
88
+ <glide-core-dropdown-option label="One"></glide-core-dropdown-option>
232
89
 
233
90
  <glide-core-dropdown-option
234
91
  label="Two"
235
- value="two"
236
92
  selected
237
93
  ></glide-core-dropdown-option>
238
94
 
239
95
  <glide-core-dropdown-option
240
96
  label="Three"
241
- value="three"
242
97
  selected
243
98
  ></glide-core-dropdown-option>
244
99
  </glide-core-dropdown>`);
@@ -249,55 +104,16 @@ it('activates the last selected option when options are initially selected', asy
249
104
  });
250
105
  it('is scrollable', async () => {
251
106
  const component = await fixture(html `<glide-core-dropdown open>
252
- <glide-core-dropdown-option
253
- label="One"
254
- value="one"
255
- ></glide-core-dropdown-option>
256
-
257
- <glide-core-dropdown-option
258
- label="Two"
259
- value="two"
260
- ></glide-core-dropdown-option>
261
-
262
- <glide-core-dropdown-option
263
- label="Three"
264
- value="three"
265
- ></glide-core-dropdown-option>
266
-
267
- <glide-core-dropdown-option
268
- label="Four"
269
- value="four"
270
- ></glide-core-dropdown-option>
271
-
272
- <glide-core-dropdown-option
273
- label="Five"
274
- value="five"
275
- ></glide-core-dropdown-option>
276
-
277
- <glide-core-dropdown-option
278
- label="Six"
279
- value="six"
280
- ></glide-core-dropdown-option>
281
-
282
- <glide-core-dropdown-option
283
- label="Seven"
284
- value="seven"
285
- ></glide-core-dropdown-option>
286
-
287
- <glide-core-dropdown-option
288
- label="Eight"
289
- value="eight"
290
- ></glide-core-dropdown-option>
291
-
292
- <glide-core-dropdown-option
293
- label="Nine"
294
- value="nine"
295
- ></glide-core-dropdown-option>
296
-
297
- <glide-core-dropdown-option
298
- label="Ten"
299
- value="ten"
300
- ></glide-core-dropdown-option>
107
+ <glide-core-dropdown-option label="One"></glide-core-dropdown-option>
108
+ <glide-core-dropdown-option label="Two"></glide-core-dropdown-option>
109
+ <glide-core-dropdown-option label="Three"></glide-core-dropdown-option>
110
+ <glide-core-dropdown-option label="Four"></glide-core-dropdown-option>
111
+ <glide-core-dropdown-option label="Five"></glide-core-dropdown-option>
112
+ <glide-core-dropdown-option label="Six"></glide-core-dropdown-option>
113
+ <glide-core-dropdown-option label="Seven"></glide-core-dropdown-option>
114
+ <glide-core-dropdown-option label="Eight"></glide-core-dropdown-option>
115
+ <glide-core-dropdown-option label="Nine"></glide-core-dropdown-option>
116
+ <glide-core-dropdown-option label="Ten"></glide-core-dropdown-option>
301
117
  </glide-core-dropdown>`);
302
118
  // Wait for it to open.
303
119
  await aTimeout(0);
@@ -307,50 +123,15 @@ it('is scrollable', async () => {
307
123
  });
308
124
  it('is not scrollable', async () => {
309
125
  const component = await fixture(html `<glide-core-dropdown open>
310
- <glide-core-dropdown-option
311
- label="One"
312
- value="one"
313
- ></glide-core-dropdown-option>
314
-
315
- <glide-core-dropdown-option
316
- label="Two"
317
- value="two"
318
- ></glide-core-dropdown-option>
319
-
320
- <glide-core-dropdown-option
321
- label="Three"
322
- value="three"
323
- ></glide-core-dropdown-option>
324
-
325
- <glide-core-dropdown-option
326
- label="Four"
327
- value="four"
328
- ></glide-core-dropdown-option>
329
-
330
- <glide-core-dropdown-option
331
- label="Five"
332
- value="five"
333
- ></glide-core-dropdown-option>
334
-
335
- <glide-core-dropdown-option
336
- label="Six"
337
- value="six"
338
- ></glide-core-dropdown-option>
339
-
340
- <glide-core-dropdown-option
341
- label="Seven"
342
- value="seven"
343
- ></glide-core-dropdown-option>
344
-
345
- <glide-core-dropdown-option
346
- label="Eight"
347
- value="eight"
348
- ></glide-core-dropdown-option>
349
-
350
- <glide-core-dropdown-option
351
- label="Nine"
352
- value="nine"
353
- ></glide-core-dropdown-option>
126
+ <glide-core-dropdown-option label="One"></glide-core-dropdown-option>
127
+ <glide-core-dropdown-option label="Two"></glide-core-dropdown-option>
128
+ <glide-core-dropdown-option label="Three"></glide-core-dropdown-option>
129
+ <glide-core-dropdown-option label="Four"></glide-core-dropdown-option>
130
+ <glide-core-dropdown-option label="Five"></glide-core-dropdown-option>
131
+ <glide-core-dropdown-option label="Six"></glide-core-dropdown-option>
132
+ <glide-core-dropdown-option label="Seven"></glide-core-dropdown-option>
133
+ <glide-core-dropdown-option label="Eight"></glide-core-dropdown-option>
134
+ <glide-core-dropdown-option label="Nine"></glide-core-dropdown-option>
354
135
  </glide-core-dropdown>`);
355
136
  // Wait for it to open.
356
137
  await aTimeout(0);
@@ -371,7 +152,6 @@ it('does not throw if the default slot only contains whitespace', async () => {
371
152
  await fixture(html `<glide-core-dropdown label="Label" placeholder="Placeholder">
372
153
  ${repeat([], () => html `<glide-core-dropdown-option
373
154
  label="Option"
374
- value="option"
375
155
  ></glide-core-dropdown-option>`)}
376
156
  </glide-core-dropdown>`);
377
157
  }
@@ -6,14 +6,10 @@ import GlideCoreTag from './tag.js';
6
6
  GlideCoreDropdown.shadowRootOptions.mode = 'open';
7
7
  it('is accessible', async () => {
8
8
  const component = await fixture(html `<glide-core-dropdown label="Label" placeholder="Placeholder" multiple>
9
- <glide-core-dropdown-option
10
- label="One"
11
- value="one"
12
- ></glide-core-dropdown-option>
9
+ <glide-core-dropdown-option label="One"></glide-core-dropdown-option>
13
10
 
14
11
  <glide-core-dropdown-option
15
12
  label="Two"
16
- value="two"
17
13
  selected
18
14
  ></glide-core-dropdown-option>
19
15
  </glide-core-dropdown>`);
@@ -44,13 +40,11 @@ it('has selected option labels when options are initially selected', async () =>
44
40
  const component = await fixture(html `<glide-core-dropdown label="Label" placeholder="Placeholder" multiple>
45
41
  <glide-core-dropdown-option
46
42
  label="One"
47
- value="one"
48
43
  selected
49
44
  ></glide-core-dropdown-option>
50
45
 
51
46
  <glide-core-dropdown-option
52
47
  label="Two"
53
- value="two"
54
48
  selected
55
49
  ></glide-core-dropdown-option>
56
50
  </glide-core-dropdown>`);
@@ -63,14 +57,10 @@ it('has a tag when an option is initially selected', async () => {
63
57
  const component = await fixture(html `<glide-core-dropdown label="Label" placeholder="Placeholder" multiple>
64
58
  <glide-core-dropdown-option
65
59
  label="One"
66
- value="one"
67
60
  selected
68
61
  ></glide-core-dropdown-option>
69
62
 
70
- <glide-core-dropdown-option
71
- label="Two"
72
- value="two"
73
- ></glide-core-dropdown-option>
63
+ <glide-core-dropdown-option label="Two"></glide-core-dropdown-option>
74
64
  </glide-core-dropdown>`);
75
65
  const tag = component.shadowRoot?.querySelector('[data-test="tag"]');
76
66
  expect(tag?.checkVisibility()).to.be.true;
@@ -86,14 +76,10 @@ it('shows Select All', async () => {
86
76
  >
87
77
  <glide-core-dropdown-option
88
78
  label="One"
89
- value="one"
90
79
  selected
91
80
  ></glide-core-dropdown-option>
92
81
 
93
- <glide-core-dropdown-option
94
- label="Two"
95
- value="two"
96
- ></glide-core-dropdown-option>
82
+ <glide-core-dropdown-option label="Two"></glide-core-dropdown-option>
97
83
  </glide-core-dropdown>`);
98
84
  // Wait for it to open.
99
85
  await aTimeout(0);
@@ -109,13 +95,11 @@ it('sets Select All as selected when all options are initially selected', async
109
95
  >
110
96
  <glide-core-dropdown-option
111
97
  label="One"
112
- value="one"
113
98
  selected
114
99
  ></glide-core-dropdown-option>
115
100
 
116
101
  <glide-core-dropdown-option
117
102
  label="Two"
118
- value="two"
119
103
  selected
120
104
  ></glide-core-dropdown-option>
121
105
  </glide-core-dropdown>`);
@@ -129,15 +113,8 @@ it('sets Select All as deselected when no options are initially selected', async
129
113
  multiple
130
114
  select-all
131
115
  >
132
- <glide-core-dropdown-option
133
- label="One"
134
- value="one"
135
- ></glide-core-dropdown-option>
136
-
137
- <glide-core-dropdown-option
138
- label="Two"
139
- value="two"
140
- ></glide-core-dropdown-option>
116
+ <glide-core-dropdown-option label="One"></glide-core-dropdown-option>
117
+ <glide-core-dropdown-option label="Two"></glide-core-dropdown-option>
141
118
  </glide-core-dropdown>`);
142
119
  const selectAll = component.shadowRoot?.querySelector('[data-test="select-all"]');
143
120
  expect(selectAll?.selected).to.be.false;
@@ -151,14 +128,10 @@ it('sets Select All as indeterminate when not all options are initially selected
151
128
  >
152
129
  <glide-core-dropdown-option
153
130
  label="One"
154
- value="one"
155
131
  selected
156
132
  ></glide-core-dropdown-option>
157
133
 
158
- <glide-core-dropdown-option
159
- label="Two"
160
- value="two"
161
- ></glide-core-dropdown-option>
134
+ <glide-core-dropdown-option label="Two"></glide-core-dropdown-option>
162
135
  </glide-core-dropdown>`);
163
136
  const selectAll = component.shadowRoot?.querySelector('[data-test="select-all"]');
164
137
  expect(selectAll?.privateIndeterminate).to.be.true;
@@ -170,15 +143,8 @@ it('does not set Select All as indeterminate when no options are initially selec
170
143
  multiple
171
144
  select-all
172
145
  >
173
- <glide-core-dropdown-option
174
- label="One"
175
- value="one"
176
- ></glide-core-dropdown-option>
177
-
178
- <glide-core-dropdown-option
179
- label="Two"
180
- value="two"
181
- ></glide-core-dropdown-option>
146
+ <glide-core-dropdown-option label="One"></glide-core-dropdown-option>
147
+ <glide-core-dropdown-option label="Two"></glide-core-dropdown-option>
182
148
  </glide-core-dropdown>`);
183
149
  const selectAll = component.shadowRoot?.querySelector('[data-test="select-all"]');
184
150
  expect(selectAll?.privateIndeterminate).to.be.false;
@@ -192,13 +158,11 @@ it('does not set Select All as indeterminate when all options are initially sele
192
158
  >
193
159
  <glide-core-dropdown-option
194
160
  label="One"
195
- value="one"
196
161
  selected
197
162
  ></glide-core-dropdown-option>
198
163
 
199
164
  <glide-core-dropdown-option
200
165
  label="Two"
201
- value="two"
202
166
  selected
203
167
  ></glide-core-dropdown-option>
204
168
  </glide-core-dropdown>`);
@@ -207,15 +171,8 @@ it('does not set Select All as indeterminate when all options are initially sele
207
171
  });
208
172
  it('sets its internal label to `placeholder` when no option is initially selected', async () => {
209
173
  const component = await fixture(html `<glide-core-dropdown label="Label" placeholder="Placeholder" multiple>
210
- <glide-core-dropdown-option
211
- label="One"
212
- value="one"
213
- ></glide-core-dropdown-option>
214
-
215
- <glide-core-dropdown-option
216
- label="Two"
217
- value="two"
218
- ></glide-core-dropdown-option>
174
+ <glide-core-dropdown-option label="One"></glide-core-dropdown-option>
175
+ <glide-core-dropdown-option label="Two"></glide-core-dropdown-option>
219
176
  </glide-core-dropdown>`);
220
177
  const label = component.shadowRoot?.querySelector('[data-test="internal-label"]');
221
178
  expect(label?.textContent?.trim()).to.equal('Placeholder');
@@ -229,17 +186,13 @@ it('has no internal label when an option is initially selected', async () => {
229
186
  >
230
187
  <glide-core-dropdown-option
231
188
  label="One"
232
- value="one"
233
189
  selected
234
190
  ></glide-core-dropdown-option>
235
191
 
236
- <glide-core-dropdown-option
237
- label="Two"
238
- value="two"
239
- ></glide-core-dropdown-option>
192
+ <glide-core-dropdown-option label="Two"></glide-core-dropdown-option>
240
193
  </glide-core-dropdown>`);
241
194
  const label = component.shadowRoot?.querySelector('[data-test="internal-label"]');
242
- expect(label).to.not.exist;
195
+ expect(label?.checkVisibility()).to.not.be.ok;
243
196
  });
244
197
  it('has a "multiselect" icon for each selected option with a value', async () => {
245
198
  const component = await fixture(html `<glide-core-dropdown label="Label" placeholder="Placeholder" multiple>
@@ -267,7 +220,7 @@ it('has a "multiselect" icon for each selected option with a value', async () =>
267
220
  const icons = component.shadowRoot?.querySelectorAll('[data-test="multiselect-icon-slot"]');
268
221
  expect(icons?.length).to.equal(2);
269
222
  });
270
- it('has no "multiselect" icons', async () => {
223
+ it('has no "multiselect" icons when no options are selected', async () => {
271
224
  const component = await fixture(html `<glide-core-dropdown label="Label" placeholder="Placeholder" multiple>
272
225
  <div slot="icon:one">✓</div>
273
226
  <div slot="icon:two">✓</div>
@@ -4,10 +4,7 @@ import GlideCoreDropdown from './dropdown.js';
4
4
  GlideCoreDropdown.shadowRootOptions.mode = 'open';
5
5
  it('is accessible ', async () => {
6
6
  const component = await fixture(html `<glide-core-dropdown label="Label" placeholder="Placeholder">
7
- <glide-core-dropdown-option
8
- label="Label"
9
- value="value"
10
- ></glide-core-dropdown-option>
7
+ <glide-core-dropdown-option label="Label"></glide-core-dropdown-option>
11
8
  </glide-core-dropdown>`);
12
9
  await expect(component).to.be.accessible();
13
10
  });
@@ -15,7 +12,6 @@ it('has a selected option label when an option is initially selected', async ()
15
12
  const component = await fixture(html `<glide-core-dropdown label="Label" placeholder="Placeholder">
16
13
  <glide-core-dropdown-option
17
14
  label="One"
18
- value="one"
19
15
  selected
20
16
  ></glide-core-dropdown-option>
21
17
  </glide-core-dropdown>`);
@@ -23,17 +19,15 @@ it('has a selected option label when an option is initially selected', async ()
23
19
  expect(labels?.length).to.equal(1);
24
20
  expect(labels?.[0]?.textContent?.trim()).to.equal('One,');
25
21
  });
26
- it('sets its internal label to the last initially selected option', async () => {
22
+ it('sets its internal `label` to the last initially selected option', async () => {
27
23
  const component = await fixture(html `<glide-core-dropdown label="Label" placeholder="Placeholder">
28
24
  <glide-core-dropdown-option
29
25
  label="One"
30
- value="one"
31
26
  selected
32
27
  ></glide-core-dropdown-option>
33
28
 
34
29
  <glide-core-dropdown-option
35
30
  label="Two"
36
- value="two"
37
31
  selected
38
32
  ></glide-core-dropdown-option>
39
33
  </glide-core-dropdown>`);
@@ -7,60 +7,17 @@ import GlideCoreDropdownOption from './dropdown.option.js';
7
7
  GlideCoreDropdown.shadowRootOptions.mode = 'open';
8
8
  GlideCoreDropdownOption.shadowRootOptions.mode = 'open';
9
9
  const defaultSlot = html `
10
- <glide-core-dropdown-option
11
- label="One"
12
- value="one"
13
- ></glide-core-dropdown-option>
14
-
15
- <glide-core-dropdown-option
16
- label="Two"
17
- value="two"
18
- ></glide-core-dropdown-option>
19
-
20
- <glide-core-dropdown-option
21
- label="Three"
22
- value="three"
23
- ></glide-core-dropdown-option>
24
-
25
- <glide-core-dropdown-option
26
- label="Four"
27
- value="four"
28
- ></glide-core-dropdown-option>
29
-
30
- <glide-core-dropdown-option
31
- label="Five"
32
- value="five"
33
- ></glide-core-dropdown-option>
34
-
35
- <glide-core-dropdown-option
36
- label="Six"
37
- value="six"
38
- ></glide-core-dropdown-option>
39
-
40
- <glide-core-dropdown-option
41
- label="Seven"
42
- value="seven"
43
- ></glide-core-dropdown-option>
44
-
45
- <glide-core-dropdown-option
46
- label="Eight"
47
- value="eight"
48
- ></glide-core-dropdown-option>
49
-
50
- <glide-core-dropdown-option
51
- label="Nine"
52
- value="nine"
53
- ></glide-core-dropdown-option>
54
-
55
- <glide-core-dropdown-option
56
- label="Ten"
57
- value="ten"
58
- ></glide-core-dropdown-option>
59
-
60
- <glide-core-dropdown-option
61
- label="Eleven"
62
- value="eleven"
63
- ></glide-core-dropdown-option>
10
+ <glide-core-dropdown-option label="One"></glide-core-dropdown-option>
11
+ <glide-core-dropdown-option label="Two"></glide-core-dropdown-option>
12
+ <glide-core-dropdown-option label="Three"></glide-core-dropdown-option>
13
+ <glide-core-dropdown-option label="Four"></glide-core-dropdown-option>
14
+ <glide-core-dropdown-option label="Five"></glide-core-dropdown-option>
15
+ <glide-core-dropdown-option label="Six"></glide-core-dropdown-option>
16
+ <glide-core-dropdown-option label="Seven"></glide-core-dropdown-option>
17
+ <glide-core-dropdown-option label="Eight"></glide-core-dropdown-option>
18
+ <glide-core-dropdown-option label="Nine"></glide-core-dropdown-option>
19
+ <glide-core-dropdown-option label="Ten"></glide-core-dropdown-option>
20
+ <glide-core-dropdown-option label="Eleven"></glide-core-dropdown-option>
64
21
  `;
65
22
  it('dispatches a "filter" event on "input"', async () => {
66
23
  const component = await fixture(html `<glide-core-dropdown label="Label" placeholder="Placeholder">
@@ -71,6 +28,7 @@ it('dispatches a "filter" event on "input"', async () => {
71
28
  const event = await oneEvent(component, 'filter');
72
29
  expect(event instanceof CustomEvent).to.be.true;
73
30
  expect(event.bubbles).to.be.true;
31
+ expect(event.composed).to.be.true;
74
32
  expect(event.detail).to.equal('o');
75
33
  });
76
34
  it('does not dispatch "input" events on input', async () => {