@triptease/tt-combobox 5.0.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.
- package/LICENSE +21 -0
- package/README.md +62 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +146 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov.info +1079 -0
- package/custom-elements.json +654 -0
- package/demo/index.html +30 -0
- package/dist/src/TtCombobox.d.ts +77 -0
- package/dist/src/TtCombobox.js +456 -0
- package/dist/src/TtCombobox.js.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/styles.d.ts +1 -0
- package/dist/src/styles.js +276 -0
- package/dist/src/styles.js.map +1 -0
- package/dist/src/tt-combobox.d.ts +2 -0
- package/dist/src/tt-combobox.js +6 -0
- package/dist/src/tt-combobox.js.map +1 -0
- package/package.json +84 -0
- package/test/tt-combobox.test.ts +413 -0
- package/tsconfig.json +22 -0
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import {fixture, expect, oneEvent, elementUpdated} from '@open-wc/testing';
|
|
3
|
+
import { TtCombobox } from '../src/index.js';
|
|
4
|
+
import '../src/tt-combobox.js';
|
|
5
|
+
|
|
6
|
+
describe('TtCombobox', () => {
|
|
7
|
+
const getCombobox = (el: TtCombobox) => el.shadowRoot!.querySelector('[role="combobox"]') as HTMLInputElement;
|
|
8
|
+
|
|
9
|
+
const comboboxPlaceholderText = (combobox: HTMLInputElement) => combobox.getAttribute('placeholder');
|
|
10
|
+
|
|
11
|
+
it('Should render with the default placeholder text', async () => {
|
|
12
|
+
const el = await fixture<TtCombobox>(html`
|
|
13
|
+
<tt-combobox id="combobox">
|
|
14
|
+
<span slot="label">Test combobox</span>
|
|
15
|
+
<option slot="option" value="1">Option 1</option>
|
|
16
|
+
<option slot="option" value="2">Option 2</option>
|
|
17
|
+
<option slot="option" value="3">Option 3</option>
|
|
18
|
+
</tt-combobox>`);
|
|
19
|
+
|
|
20
|
+
const combobox = getCombobox(el);
|
|
21
|
+
|
|
22
|
+
await expect(comboboxPlaceholderText(combobox)).to.equal('No options selected');
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('should render with the options visible when clicking the combobox', async () => {
|
|
26
|
+
const el = await fixture<TtCombobox>(html`
|
|
27
|
+
<tt-combobox id="combobox">
|
|
28
|
+
<span slot="label">Test combobox</span>
|
|
29
|
+
<option slot="option" value="1">Option 1</option>
|
|
30
|
+
<option slot="option" value="2">Option 2</option>
|
|
31
|
+
<option slot="option" value="3">Option 3</option>
|
|
32
|
+
</tt-combobox>`);
|
|
33
|
+
|
|
34
|
+
const combobox = getCombobox(el);
|
|
35
|
+
combobox.click();
|
|
36
|
+
|
|
37
|
+
const options = el.shadowRoot!.querySelectorAll('[role="option"]');
|
|
38
|
+
await expect(options.length).to.equal(3);
|
|
39
|
+
options.forEach((option) => {
|
|
40
|
+
expect(option.checkVisibility()).to.be.true;
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('should update the placeholder with the selected option', async () => {
|
|
45
|
+
const el = await fixture<TtCombobox>(html`
|
|
46
|
+
<tt-combobox id="combobox">
|
|
47
|
+
<span slot="label">Test combobox</span>
|
|
48
|
+
<option slot="option" value="1">Option 1</option>
|
|
49
|
+
<option slot="option" value="2">Option 2</option>
|
|
50
|
+
<option slot="option" value="3">Option 3</option>
|
|
51
|
+
</tt-combobox>`);
|
|
52
|
+
|
|
53
|
+
const combobox = getCombobox(el);
|
|
54
|
+
combobox.click();
|
|
55
|
+
|
|
56
|
+
const option = el.shadowRoot!.querySelector('[role="option"][data-value="2"]') as HTMLLIElement;
|
|
57
|
+
option.click();
|
|
58
|
+
await elementUpdated(el);
|
|
59
|
+
expect(comboboxPlaceholderText(combobox)).to.equal('Option 2');
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('should display select all option when multiselect is true and display-select-all is true, and select all options when clicked', async () => {
|
|
63
|
+
const el = await fixture<TtCombobox>(html`
|
|
64
|
+
<tt-combobox id="combobox" multiselect display-select-all>
|
|
65
|
+
<span slot="label">Test combobox</span>
|
|
66
|
+
<option slot="option" value="1">Option 1</option>
|
|
67
|
+
<option slot="option" value="2">Option 2</option>
|
|
68
|
+
<option slot="option" value="3">Option 3</option>
|
|
69
|
+
</tt-combobox>`);
|
|
70
|
+
|
|
71
|
+
const combobox = getCombobox(el);
|
|
72
|
+
await combobox.click();
|
|
73
|
+
|
|
74
|
+
const selectAll = el.shadowRoot!.querySelector('[role="option"][data-value="select-all"]') as HTMLLIElement;
|
|
75
|
+
expect(selectAll).to.exist;
|
|
76
|
+
|
|
77
|
+
selectAll.click();
|
|
78
|
+
await oneEvent(el, 'change');
|
|
79
|
+
|
|
80
|
+
const options = el.shadowRoot!.querySelectorAll('[role="option"]');
|
|
81
|
+
options.forEach((option) => {
|
|
82
|
+
expect(option.getAttribute('aria-selected')).to.equal('true');
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it('should not allow a disabled option to be selected', async () => {
|
|
87
|
+
const el = await fixture<TtCombobox>(html`
|
|
88
|
+
<tt-combobox id="combobox">
|
|
89
|
+
<span slot="label">Test combobox</span>
|
|
90
|
+
<option slot="option" value="1">Option 1</option>
|
|
91
|
+
<option slot="option" value="2" disabled>Option 2</option>
|
|
92
|
+
<option slot="option" value="3">Option 3</option>
|
|
93
|
+
</tt-combobox>`);
|
|
94
|
+
|
|
95
|
+
const combobox = getCombobox(el);
|
|
96
|
+
await combobox.click();
|
|
97
|
+
|
|
98
|
+
const option = el.shadowRoot!.querySelector('[role="option"][data-value="2"]') as HTMLLIElement;
|
|
99
|
+
option.click();
|
|
100
|
+
|
|
101
|
+
await expect(comboboxPlaceholderText(combobox)).to.equal('No options selected');
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('should disable the combobox when the disabled attribute is set', async () => {
|
|
105
|
+
const el = await fixture<TtCombobox>(html`
|
|
106
|
+
<tt-combobox id="combobox" disabled>
|
|
107
|
+
<span slot="label">Test combobox</span>
|
|
108
|
+
<option slot="option" value="1">Option 1</option>
|
|
109
|
+
<option slot="option" value="2">Option 2</option>
|
|
110
|
+
<option slot="option" value="3">Option 3</option>
|
|
111
|
+
</tt-combobox>`);
|
|
112
|
+
|
|
113
|
+
const combobox = getCombobox(el);
|
|
114
|
+
expect(combobox.disabled).to.be.true;
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
xit('should render the error message', async () => {
|
|
118
|
+
const el = await fixture<TtCombobox>(html`
|
|
119
|
+
<tt-combobox id="combobox">
|
|
120
|
+
<span slot="label">Test combobox</span>
|
|
121
|
+
<option slot="option" value="1">Option 1</option>
|
|
122
|
+
<option slot="option" value="2">Option 2</option>
|
|
123
|
+
<option slot="option" value="3">Option 3</option>
|
|
124
|
+
<span slot="error">There was an error</span>
|
|
125
|
+
</tt-combobox>`);
|
|
126
|
+
await elementUpdated(el);
|
|
127
|
+
const combobox = getCombobox(el);
|
|
128
|
+
const ariaInvalid = combobox.getAttribute('aria-invalid');
|
|
129
|
+
expect(ariaInvalid).to.equal('false');
|
|
130
|
+
|
|
131
|
+
const errorMessage = el.shadowRoot!.querySelector('[id="error-msg-combobox"]');
|
|
132
|
+
expect(errorMessage!.checkVisibility()).to.be.false;
|
|
133
|
+
|
|
134
|
+
el.invalid = true;
|
|
135
|
+
|
|
136
|
+
await elementUpdated(el);
|
|
137
|
+
|
|
138
|
+
expect(combobox).to.have.attribute('aria-invalid');
|
|
139
|
+
expect(errorMessage!.checkVisibility()).to.be.true;
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
it('should call the event handler when the value changes', async () => {
|
|
143
|
+
const el = await fixture<TtCombobox>(html`
|
|
144
|
+
<tt-combobox id="combobox" >
|
|
145
|
+
<span slot="label">Test combobox</span>
|
|
146
|
+
<option slot="option" value="1">Option 1</option>
|
|
147
|
+
<option slot="option" value="2">Option 2</option>
|
|
148
|
+
<option slot="option" value="3">Option 3</option>
|
|
149
|
+
</tt-combobox>`);
|
|
150
|
+
|
|
151
|
+
const combobox = getCombobox(el);
|
|
152
|
+
|
|
153
|
+
combobox.click();
|
|
154
|
+
|
|
155
|
+
const option = el.shadowRoot!.querySelector('[role="option"][data-value="2"]') as HTMLLIElement;
|
|
156
|
+
option.click();
|
|
157
|
+
|
|
158
|
+
const event = await oneEvent(el, 'change');
|
|
159
|
+
const eventValue = (event.target! as HTMLLIElement).value;
|
|
160
|
+
expect(eventValue).to.be.an('array').that.includes('2');
|
|
161
|
+
})
|
|
162
|
+
|
|
163
|
+
it('Should prevent the form from submitting when it\'s required and no option is selected', async () => {
|
|
164
|
+
const el = await fixture<TtCombobox>(html`
|
|
165
|
+
<tt-combobox id="combobox" required>
|
|
166
|
+
<span slot="label">Test combobox</span>
|
|
167
|
+
<option slot="option" value="1">Option 1</option>
|
|
168
|
+
<option slot="option" value="2">Option 2</option>
|
|
169
|
+
<option slot="option" value="3">Option 3</option>
|
|
170
|
+
</tt-combobox>`);
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
const form = document.createElement('form');
|
|
174
|
+
form.appendChild(el);
|
|
175
|
+
document.body.appendChild(form);
|
|
176
|
+
|
|
177
|
+
const submitEvent = new Event('submit', { bubbles: true });
|
|
178
|
+
form.dispatchEvent(submitEvent);
|
|
179
|
+
|
|
180
|
+
await elementUpdated(el);
|
|
181
|
+
|
|
182
|
+
expect(form.checkValidity()).to.be.false;
|
|
183
|
+
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
it('passes the a11y audit', async () => {
|
|
187
|
+
const el = await fixture<TtCombobox>(html`
|
|
188
|
+
<tt-combobox></tt-combobox>`);
|
|
189
|
+
|
|
190
|
+
await expect(el).shadowDom.to.be.accessible();
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
it('should allow hidden options', async () => {
|
|
194
|
+
const el = await fixture<TtCombobox>(html`
|
|
195
|
+
<tt-combobox id="combobox" multiselect display-select-all>
|
|
196
|
+
<span slot="label">Test combobox</span>
|
|
197
|
+
<option slot="option" value="1">Option 1</option>
|
|
198
|
+
<option slot="option" value="2">Option 2</option>
|
|
199
|
+
<option slot="option" value="3">Option 3</option>
|
|
200
|
+
<option slot="option" value="4" hidden>Option 4</option>
|
|
201
|
+
</tt-combobox>`);
|
|
202
|
+
|
|
203
|
+
const combobox = getCombobox(el);
|
|
204
|
+
combobox.click();
|
|
205
|
+
|
|
206
|
+
await combobox.click();
|
|
207
|
+
|
|
208
|
+
const selectAll = el.shadowRoot!.querySelector('[role="option"][data-value="select-all"]') as HTMLLIElement;
|
|
209
|
+
expect(selectAll).to.exist;
|
|
210
|
+
|
|
211
|
+
selectAll.click();
|
|
212
|
+
const changeEvent = await oneEvent<InputEvent>(el, 'change');
|
|
213
|
+
|
|
214
|
+
expect(changeEvent).to.exist;
|
|
215
|
+
expect((changeEvent.target as TtCombobox).value).to.deep.equal(['1', '2', '3', '4']);
|
|
216
|
+
|
|
217
|
+
const hiddenOption = el.shadowRoot!.querySelector('[role="option"][data-value="4"]') as HTMLLIElement;
|
|
218
|
+
expect(hiddenOption).to.exist;
|
|
219
|
+
expect(hiddenOption).to.have.attribute('aria-hidden', 'true');
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
it('should not include hidden options in the placeholder text', async () => {
|
|
223
|
+
const el = await fixture<TtCombobox>(html`
|
|
224
|
+
<tt-combobox id="combobox" multiselect display-select-all>
|
|
225
|
+
<span slot="label">Test combobox</span>
|
|
226
|
+
<option slot="option" value="1">Option 1</option>
|
|
227
|
+
<option slot="option" value="2">Option 2</option>
|
|
228
|
+
<option slot="option" value="3">Option 3</option>
|
|
229
|
+
<option slot="option" value="4" hidden>Option 4</option>
|
|
230
|
+
</tt-combobox>`);
|
|
231
|
+
|
|
232
|
+
const combobox = getCombobox(el);
|
|
233
|
+
combobox.click();
|
|
234
|
+
|
|
235
|
+
await combobox.click();
|
|
236
|
+
|
|
237
|
+
const selectAll = el.shadowRoot!.querySelector('[role="option"][data-value="select-all"]') as HTMLLIElement;
|
|
238
|
+
expect(selectAll).to.exist;
|
|
239
|
+
|
|
240
|
+
selectAll.click();
|
|
241
|
+
|
|
242
|
+
(<HTMLLIElement>el.shadowRoot!.querySelector('[role="option"][data-value="3"]')).click();
|
|
243
|
+
|
|
244
|
+
const changeEvent = await oneEvent<InputEvent>(el, 'change');
|
|
245
|
+
|
|
246
|
+
expect(changeEvent).to.exist;
|
|
247
|
+
expect((changeEvent.target as TtCombobox).value).to.deep.equal(['1', '2', '4']);
|
|
248
|
+
|
|
249
|
+
expect(combobox.placeholder).to.equal('2 options selected');
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
it('should include selected options in the value', async () => {
|
|
255
|
+
const el = await fixture<TtCombobox>(html`
|
|
256
|
+
<tt-combobox id="combobox" multiselect display-select-all>
|
|
257
|
+
<span slot="label">Test combobox</span>
|
|
258
|
+
<option slot="option" value="1">Option 1</option>
|
|
259
|
+
<option slot="option" value="2">Option 2</option>
|
|
260
|
+
<option slot="option" value="3">Option 3</option>
|
|
261
|
+
<option slot="option" value="4" selected>Option 4</option>
|
|
262
|
+
</tt-combobox>`);
|
|
263
|
+
|
|
264
|
+
await elementUpdated(el);
|
|
265
|
+
expect(el.value).to.deep.equal(['4']);
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
it('should not deselect preselected options', async () => {
|
|
269
|
+
const el = await fixture<TtCombobox>(html`
|
|
270
|
+
<tt-combobox id="combobox" multiselect display-select-all>
|
|
271
|
+
<span slot="label">Test combobox</span>
|
|
272
|
+
<option slot="option" value="1">Option 1</option>
|
|
273
|
+
<option slot="option" value="2">Option 2</option>
|
|
274
|
+
<option slot="option" value="3">Option 3</option>
|
|
275
|
+
<option slot="option" value="4" selected>Option 4</option>
|
|
276
|
+
</tt-combobox>`);
|
|
277
|
+
|
|
278
|
+
await elementUpdated(el);
|
|
279
|
+
|
|
280
|
+
const combobox = getCombobox(el);
|
|
281
|
+
combobox.click();
|
|
282
|
+
const selectAll = el.shadowRoot!.querySelector('[role="option"][data-value="select-all"]') as HTMLLIElement;
|
|
283
|
+
selectAll.click();
|
|
284
|
+
await elementUpdated(el);
|
|
285
|
+
|
|
286
|
+
expect(el.value).to.have.all.members(['1', '2', '3', '4']);
|
|
287
|
+
|
|
288
|
+
selectAll.click();
|
|
289
|
+
await elementUpdated(el);
|
|
290
|
+
|
|
291
|
+
expect(el.value).to.deep.equal(['4']);
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
it('should deselect an option when the selected attribute is removed', async () => {
|
|
295
|
+
const el = await fixture<TtCombobox>(html`
|
|
296
|
+
<tt-combobox id="combobox" multiselect display-select-all>
|
|
297
|
+
<span slot="label">Test combobox</span>
|
|
298
|
+
<option slot="option" value="1">Option 1</option>
|
|
299
|
+
<option slot="option" value="2">Option 2</option>
|
|
300
|
+
<option slot="option" value="3">Option 3</option>
|
|
301
|
+
<option slot="option" value="4" selected>Option 4</option>
|
|
302
|
+
</tt-combobox>`);
|
|
303
|
+
|
|
304
|
+
await elementUpdated(el);
|
|
305
|
+
|
|
306
|
+
expect(el.value).to.deep.equal(['4']);
|
|
307
|
+
|
|
308
|
+
const option = el.querySelector('option[selected]');
|
|
309
|
+
expect(option).not.to.be.null;
|
|
310
|
+
|
|
311
|
+
option!.removeAttribute('selected');
|
|
312
|
+
|
|
313
|
+
await elementUpdated(el);
|
|
314
|
+
|
|
315
|
+
expect(el.value).to.deep.equal([]);
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
describe('Form Integration', () => {
|
|
319
|
+
it('should include its values in FormData when submitted', async () => {
|
|
320
|
+
// Create a form with the combobox component
|
|
321
|
+
const form = await fixture<HTMLFormElement>(html`
|
|
322
|
+
<form method="post" action="#">
|
|
323
|
+
<input type="text" name="text_field" value="test_input">
|
|
324
|
+
<tt-combobox name="country_select" id="combobox">
|
|
325
|
+
<option slot="option" value="us">United States</option>
|
|
326
|
+
<option slot="option" value="ca">Canada</option>
|
|
327
|
+
<option slot="option" value="mx">Mexico</option>
|
|
328
|
+
</tt-combobox>
|
|
329
|
+
<button type="submit">Submit</button>
|
|
330
|
+
</form>
|
|
331
|
+
`);
|
|
332
|
+
|
|
333
|
+
const combobox = form.querySelector('tt-combobox') as TtCombobox;
|
|
334
|
+
expect(combobox).to.exist;
|
|
335
|
+
|
|
336
|
+
// Select an option by setting the value directly
|
|
337
|
+
combobox.value = ['ca'];
|
|
338
|
+
await elementUpdated(combobox);
|
|
339
|
+
|
|
340
|
+
// Create FormData from the form and verify the combobox's value is included
|
|
341
|
+
const formData = new FormData(form);
|
|
342
|
+
const comboboxValue = formData.get('country_select');
|
|
343
|
+
|
|
344
|
+
expect(comboboxValue).to.exist;
|
|
345
|
+
const parsedValue = JSON.parse(comboboxValue as string);
|
|
346
|
+
expect(parsedValue).to.deep.equal(['ca']);
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
it('should include multiple selected values in FormData when multiselect is true', async () => {
|
|
350
|
+
// Create a form with a multiselect combobox
|
|
351
|
+
const form = await fixture<HTMLFormElement>(html`
|
|
352
|
+
<form method="post" action="#">
|
|
353
|
+
<tt-combobox name="countries" multiselect id="multiselect-combobox">
|
|
354
|
+
<option slot="option" value="us">United States</option>
|
|
355
|
+
<option slot="option" value="ca">Canada</option>
|
|
356
|
+
<option slot="option" value="mx">Mexico</option>
|
|
357
|
+
<option slot="option" value="uk">United Kingdom</option>
|
|
358
|
+
</tt-combobox>
|
|
359
|
+
<button type="submit">Submit</button>
|
|
360
|
+
</form>
|
|
361
|
+
`);
|
|
362
|
+
|
|
363
|
+
const combobox = form.querySelector('tt-combobox') as TtCombobox;
|
|
364
|
+
|
|
365
|
+
// Select multiple options
|
|
366
|
+
combobox.value = ['us', 'mx', 'uk'];
|
|
367
|
+
await elementUpdated(combobox);
|
|
368
|
+
|
|
369
|
+
// Verify FormData contains the multiple selected values
|
|
370
|
+
const formData = new FormData(form);
|
|
371
|
+
const comboboxValue = formData.get('countries');
|
|
372
|
+
|
|
373
|
+
expect(comboboxValue).to.exist;
|
|
374
|
+
const parsedValue = JSON.parse(comboboxValue as string);
|
|
375
|
+
expect(parsedValue).to.be.an('array').that.includes('us');
|
|
376
|
+
expect(parsedValue).to.be.an('array').that.includes('mx');
|
|
377
|
+
expect(parsedValue).to.be.an('array').that.includes('uk');
|
|
378
|
+
expect(parsedValue).to.have.lengthOf(3);
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
it('should update FormData when selections change', async () => {
|
|
382
|
+
const form = await fixture<HTMLFormElement>(html`
|
|
383
|
+
<form method="post" action="#">
|
|
384
|
+
<tt-combobox name="selection" id="combobox">
|
|
385
|
+
<option slot="option" value="option1">Option 1</option>
|
|
386
|
+
<option slot="option" value="option2">Option 2</option>
|
|
387
|
+
<option slot="option" value="option3">Option 3</option>
|
|
388
|
+
</tt-combobox>
|
|
389
|
+
</form>
|
|
390
|
+
`);
|
|
391
|
+
|
|
392
|
+
const combobox = form.querySelector('tt-combobox') as TtCombobox;
|
|
393
|
+
|
|
394
|
+
// Initial selection
|
|
395
|
+
combobox.value = ['option1'];
|
|
396
|
+
await elementUpdated(combobox);
|
|
397
|
+
|
|
398
|
+
// Check initial FormData
|
|
399
|
+
let formData = new FormData(form);
|
|
400
|
+
let value = JSON.parse(formData.get('selection') as string);
|
|
401
|
+
expect(value).to.deep.equal(['option1']);
|
|
402
|
+
|
|
403
|
+
// Change selection
|
|
404
|
+
combobox.value = ['option2'];
|
|
405
|
+
await elementUpdated(combobox);
|
|
406
|
+
|
|
407
|
+
// Check updated FormData
|
|
408
|
+
formData = new FormData(form);
|
|
409
|
+
value = JSON.parse(formData.get('selection') as string);
|
|
410
|
+
expect(value).to.deep.equal(['option2']);
|
|
411
|
+
});
|
|
412
|
+
});
|
|
413
|
+
});
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2021",
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"noEmitOnError": true,
|
|
7
|
+
"lib": ["es2021", "dom", "DOM.Iterable"],
|
|
8
|
+
"strict": true,
|
|
9
|
+
"esModuleInterop": false,
|
|
10
|
+
"allowSyntheticDefaultImports": true,
|
|
11
|
+
"experimentalDecorators": true,
|
|
12
|
+
"importHelpers": true,
|
|
13
|
+
"outDir": "dist",
|
|
14
|
+
"sourceMap": true,
|
|
15
|
+
"inlineSources": true,
|
|
16
|
+
"rootDir": "./",
|
|
17
|
+
"declaration": true,
|
|
18
|
+
"incremental": true,
|
|
19
|
+
"skipLibCheck": true
|
|
20
|
+
},
|
|
21
|
+
"include": ["**/*.ts"]
|
|
22
|
+
}
|