@@ -356,19 +356,21 @@ describe('CdkOption and CdkListbox', () => {
356
356
expect ( fixture . componentInstance . changedOption ) . toBeUndefined ( ) ;
357
357
} ) ;
358
358
359
- it ( 'should not handle type ahead on a disabled listbox' , fakeAsync ( async ( ) => {
359
+ it ( 'should not handle type ahead on a disabled listbox' , async ( ... args : unknown [ ] ) => {
360
360
const { fixture, testComponent, listboxEl, options} = await setupComponent ( ListboxWithOptions ) ;
361
- testComponent . isListboxDisabled = true ;
362
- fixture . detectChanges ( ) ;
361
+ await fakeAsync ( ( ) => {
362
+ testComponent . isListboxDisabled = true ;
363
+ fixture . detectChanges ( ) ;
363
364
364
- dispatchKeyboardEvent ( listboxEl , 'keydown' , B ) ;
365
- fixture . detectChanges ( ) ;
366
- tick ( 200 ) ;
365
+ dispatchKeyboardEvent ( listboxEl , 'keydown' , B ) ;
366
+ fixture . detectChanges ( ) ;
367
+ tick ( 200 ) ;
367
368
368
- for ( let option of options ) {
369
- expect ( option . isActive ( ) ) . toBeFalse ( ) ;
370
- }
371
- } ) ) ;
369
+ for ( let option of options ) {
370
+ expect ( option . isActive ( ) ) . toBeFalse ( ) ;
371
+ }
372
+ } ) ( args ) ;
373
+ } ) ;
372
374
373
375
it ( 'should skip disabled options when navigating with arrow keys' , async ( ) => {
374
376
const { testComponent, fixture, listbox, listboxEl, options} = await setupComponent (
@@ -438,31 +440,35 @@ describe('CdkOption and CdkListbox', () => {
438
440
expect ( optionEls [ 0 ] . classList ) . toContain ( 'cdk-option-active' ) ;
439
441
} ) ;
440
442
441
- it ( 'should change active item using type ahead' , fakeAsync ( async ( ) => {
443
+ it ( 'should change active item using type ahead' , async ( ... args : unknown [ ] ) => {
442
444
const { fixture, listbox, listboxEl, options} = await setupComponent ( ListboxWithOptions ) ;
443
- listbox . focus ( ) ;
444
- fixture . detectChanges ( ) ;
445
+ await fakeAsync ( ( ) => {
446
+ listbox . focus ( ) ;
447
+ fixture . detectChanges ( ) ;
445
448
446
- dispatchKeyboardEvent ( listboxEl , 'keydown' , B ) ;
447
- fixture . detectChanges ( ) ;
448
- tick ( 200 ) ;
449
+ dispatchKeyboardEvent ( listboxEl , 'keydown' , B ) ;
450
+ fixture . detectChanges ( ) ;
451
+ tick ( 200 ) ;
449
452
450
- expect ( options [ 2 ] . isActive ( ) ) . toBeTrue ( ) ;
451
- } ) ) ;
453
+ expect ( options [ 2 ] . isActive ( ) ) . toBeTrue ( ) ;
454
+ } ) ( args ) ;
455
+ } ) ;
452
456
453
- it ( 'should allow custom type ahead label' , fakeAsync ( async ( ) => {
457
+ it ( 'should allow custom type ahead label' , async ( ... args : unknown [ ] ) => {
454
458
const { fixture, listbox, listboxEl, options} = await setupComponent (
455
459
ListboxWithCustomTypeahead ,
456
460
) ;
457
- listbox . focus ( ) ;
458
- fixture . detectChanges ( ) ;
461
+ await fakeAsync ( ( ) => {
462
+ listbox . focus ( ) ;
463
+ fixture . detectChanges ( ) ;
459
464
460
- dispatchKeyboardEvent ( listboxEl , 'keydown' , B ) ;
461
- fixture . detectChanges ( ) ;
462
- tick ( 200 ) ;
465
+ dispatchKeyboardEvent ( listboxEl , 'keydown' , B ) ;
466
+ fixture . detectChanges ( ) ;
467
+ tick ( 200 ) ;
463
468
464
- expect ( options [ 2 ] . isActive ( ) ) . toBeTrue ( ) ;
465
- } ) ) ;
469
+ expect ( options [ 2 ] . isActive ( ) ) . toBeTrue ( ) ;
470
+ } ) ( args ) ;
471
+ } ) ;
466
472
467
473
it ( 'should focus and toggle the next item when pressing SHIFT + DOWN_ARROW' , async ( ) => {
468
474
const { fixture, listbox, listboxEl, options} = await setupComponent ( ListboxWithOptions ) ;
0 commit comments