@@ -361,12 +361,12 @@ describe('LiveController data-model Tests', () => {
361
361
<label>
362
362
Select:
363
363
<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>
366
366
</select>
367
367
</label>
368
368
369
- Option 2 is ${ data . form . select . indexOf ( 'bar' ) > - 1 ? 'selected' : 'unselected' }
369
+ Option 2 is ${ data . form . select ? .indexOf ( 'bar' ) > - 1 ? 'selected' : 'unselected' }
370
370
</div>
371
371
` ;
372
372
const data = { form : { select : [ ] } } ;
@@ -399,12 +399,12 @@ describe('LiveController data-model Tests', () => {
399
399
<label>
400
400
Select:
401
401
<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>
404
404
</select>
405
405
</label>
406
406
407
- Option 2 is ${ data . form . select . indexOf ( 'bar' ) > - 1 ? 'selected' : 'unselected' }
407
+ Option 2 is ${ data . form . select ? .indexOf ( 'bar' ) > - 1 ? 'selected' : 'unselected' }
408
408
</div>
409
409
` ;
410
410
const data = { form : { select : [ 'foo' ] } } ;
@@ -426,7 +426,7 @@ describe('LiveController data-model Tests', () => {
426
426
427
427
await userEvent . deselectOptions ( selectElement , 'bar' ) ;
428
428
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 ' ) ) ;
430
430
431
431
expect ( controller . dataValue ) . toEqual ( { form : { select : null } } ) ;
432
432
0 commit comments