Skip to content

Commit 56caf14

Browse files
committed
Fix last tests
1 parent e51f202 commit 56caf14

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/LiveComponent/assets/test/controller/model.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,12 @@ describe('LiveController data-model Tests', () => {
361361
<label>
362362
Select:
363363
<select name="form[select][]" multiple>
364-
<option value="foo" ${data.form.select.indexOf('foo') > -1 ? 'selected' : ''}>foo</option>
365-
<option value="bar" ${data.form.select.indexOf('bar') > -1 ? 'selected' : ''}>bar</option>
364+
<option value="foo" ${data.form.select?.indexOf('foo') > -1 ? 'selected' : ''}>foo</option>
365+
<option value="bar" ${data.form.select?.indexOf('bar') > -1 ? 'selected' : ''}>bar</option>
366366
</select>
367367
</label>
368368
369-
Option 2 is ${data.form.select.indexOf('bar') > -1 ? 'selected' : 'unselected' }
369+
Option 2 is ${data.form.select?.indexOf('bar') > -1 ? 'selected' : 'unselected' }
370370
</div>
371371
`;
372372
const data = { form: { select: []} };
@@ -399,12 +399,12 @@ describe('LiveController data-model Tests', () => {
399399
<label>
400400
Select:
401401
<select name="form[select][]" multiple>
402-
<option value="foo" ${data.form.select.indexOf('foo') > -1 ? 'selected' : ''}>foo</option>
403-
<option value="bar" ${data.form.select.indexOf('bar') > -1 ? 'selected' : ''}>bar</option>
402+
<option value="foo" ${data.form.select?.indexOf('foo') > -1 ? 'selected' : ''}>foo</option>
403+
<option value="bar" ${data.form.select?.indexOf('bar') > -1 ? 'selected' : ''}>bar</option>
404404
</select>
405405
</label>
406406
407-
Option 2 is ${data.form.select.indexOf('bar') > -1 ? 'selected' : 'unselected' }
407+
Option 2 is ${data.form.select?.indexOf('bar') > -1 ? 'selected' : 'unselected' }
408408
</div>
409409
`;
410410
const data = { form: { select: ['foo']} };
@@ -426,7 +426,7 @@ describe('LiveController data-model Tests', () => {
426426

427427
await userEvent.deselectOptions(selectElement, 'bar');
428428

429-
await waitFor(() => expect(element).toHaveTextContent('Select: foo bar Option 2 is deselected'));
429+
await waitFor(() => expect(element).toHaveTextContent('Select: foo bar Option 2 is unselected'));
430430

431431
expect(controller.dataValue).toEqual({form: {select: null}});
432432

0 commit comments

Comments
 (0)