@@ -356,19 +356,21 @@ describe('CdkOption and CdkListbox', () => {
356356 expect ( fixture . componentInstance . changedOption ) . toBeUndefined ( ) ;
357357 } ) ;
358358
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 ( ) => {
360360 const { fixture, testComponent, listboxEl, options} = await setupComponent ( ListboxWithOptions ) ;
361- testComponent . isListboxDisabled = true ;
362- fixture . detectChanges ( ) ;
361+ fakeAsync ( ( ) => {
362+ testComponent . isListboxDisabled = true ;
363+ fixture . detectChanges ( ) ;
363364
364- dispatchKeyboardEvent ( listboxEl , 'keydown' , B ) ;
365- fixture . detectChanges ( ) ;
366- tick ( 200 ) ;
365+ dispatchKeyboardEvent ( listboxEl , 'keydown' , B ) ;
366+ fixture . detectChanges ( ) ;
367+ tick ( 200 ) ;
367368
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+ } ) ( ) ;
373+ } ) ;
372374
373375 it ( 'should skip disabled options when navigating with arrow keys' , async ( ) => {
374376 const { testComponent, fixture, listbox, listboxEl, options} = await setupComponent (
@@ -438,31 +440,35 @@ describe('CdkOption and CdkListbox', () => {
438440 expect ( optionEls [ 0 ] . classList ) . toContain ( 'cdk-option-active' ) ;
439441 } ) ;
440442
441- it ( 'should change active item using type ahead' , fakeAsync ( async ( ) => {
443+ it ( 'should change active item using type ahead' , async ( ) => {
442444 const { fixture, listbox, listboxEl, options} = await setupComponent ( ListboxWithOptions ) ;
443- listbox . focus ( ) ;
444- fixture . detectChanges ( ) ;
445+ fakeAsync ( ( ) => {
446+ listbox . focus ( ) ;
447+ fixture . detectChanges ( ) ;
445448
446- dispatchKeyboardEvent ( listboxEl , 'keydown' , B ) ;
447- fixture . detectChanges ( ) ;
448- tick ( 200 ) ;
449+ dispatchKeyboardEvent ( listboxEl , 'keydown' , B ) ;
450+ fixture . detectChanges ( ) ;
451+ tick ( 200 ) ;
449452
450- expect ( options [ 2 ] . isActive ( ) ) . toBeTrue ( ) ;
451- } ) ) ;
453+ expect ( options [ 2 ] . isActive ( ) ) . toBeTrue ( ) ;
454+ } ) ( ) ;
455+ } ) ;
452456
453- it ( 'should allow custom type ahead label' , fakeAsync ( async ( ) => {
457+ it ( 'should allow custom type ahead label' , async ( ) => {
454458 const { fixture, listbox, listboxEl, options} = await setupComponent (
455459 ListboxWithCustomTypeahead ,
456460 ) ;
457- listbox . focus ( ) ;
458- fixture . detectChanges ( ) ;
461+ fakeAsync ( ( ) => {
462+ listbox . focus ( ) ;
463+ fixture . detectChanges ( ) ;
459464
460- dispatchKeyboardEvent ( listboxEl , 'keydown' , B ) ;
461- fixture . detectChanges ( ) ;
462- tick ( 200 ) ;
465+ dispatchKeyboardEvent ( listboxEl , 'keydown' , B ) ;
466+ fixture . detectChanges ( ) ;
467+ tick ( 200 ) ;
463468
464- expect ( options [ 2 ] . isActive ( ) ) . toBeTrue ( ) ;
465- } ) ) ;
469+ expect ( options [ 2 ] . isActive ( ) ) . toBeTrue ( ) ;
470+ } ) ;
471+ } ) ;
466472
467473 it ( 'should focus and toggle the next item when pressing SHIFT + DOWN_ARROW' , async ( ) => {
468474 const { fixture, listbox, listboxEl, options} = await setupComponent ( ListboxWithOptions ) ;
0 commit comments