@@ -150,6 +150,7 @@ describe('Key managers', () => {
150
150
151
151
keyManager . setActiveItem ( 0 ) ;
152
152
itemList . reset ( [ new FakeFocusable ( 'zero' ) , ...itemList . toArray ( ) ] ) ;
153
+ itemList . notifyOnChanges ( ) ;
153
154
keyManager . setActiveItem ( 0 ) ;
154
155
155
156
expect ( spy ) . toHaveBeenCalledTimes ( 1 ) ;
@@ -342,6 +343,7 @@ describe('Key managers', () => {
342
343
const items = itemList . toArray ( ) ;
343
344
items [ 1 ] . disabled = true ;
344
345
itemList . reset ( items ) ;
346
+ itemList . notifyOnChanges ( ) ;
345
347
346
348
// Next event should skip past disabled item from 0 to 2
347
349
keyManager . onKeydown ( this . nextKeyEvent ) ;
@@ -367,6 +369,7 @@ describe('Key managers', () => {
367
369
items [ 1 ] . disabled = undefined ;
368
370
items [ 2 ] . disabled = undefined ;
369
371
itemList . reset ( items ) ;
372
+ itemList . notifyOnChanges ( ) ;
370
373
371
374
keyManager . onKeydown ( this . nextKeyEvent ) ;
372
375
expect ( keyManager . activeItemIndex )
@@ -416,6 +419,7 @@ describe('Key managers', () => {
416
419
const items = itemList . toArray ( ) ;
417
420
items [ 2 ] . disabled = true ;
418
421
itemList . reset ( items ) ;
422
+ itemList . notifyOnChanges ( ) ;
419
423
420
424
keyManager . onKeydown ( this . nextKeyEvent ) ;
421
425
expect ( keyManager . activeItemIndex )
@@ -558,6 +562,7 @@ describe('Key managers', () => {
558
562
const items = itemList . toArray ( ) ;
559
563
items [ 0 ] . disabled = true ;
560
564
itemList . reset ( items ) ;
565
+ itemList . notifyOnChanges ( ) ;
561
566
562
567
keyManager . setFirstItemActive ( ) ;
563
568
expect ( keyManager . activeItemIndex )
@@ -580,6 +585,7 @@ describe('Key managers', () => {
580
585
const items = itemList . toArray ( ) ;
581
586
items [ 2 ] . disabled = true ;
582
587
itemList . reset ( items ) ;
588
+ itemList . notifyOnChanges ( ) ;
583
589
584
590
keyManager . setLastItemActive ( ) ;
585
591
expect ( keyManager . activeItemIndex )
@@ -602,6 +608,7 @@ describe('Key managers', () => {
602
608
const items = itemList . toArray ( ) ;
603
609
items [ 1 ] . disabled = true ;
604
610
itemList . reset ( items ) ;
611
+ itemList . notifyOnChanges ( ) ;
605
612
606
613
expect ( keyManager . activeItemIndex )
607
614
. withContext ( `Expected first item of the list to be active.` )
@@ -629,6 +636,7 @@ describe('Key managers', () => {
629
636
const items = itemList . toArray ( ) ;
630
637
items [ 1 ] . disabled = true ;
631
638
itemList . reset ( items ) ;
639
+ itemList . notifyOnChanges ( ) ;
632
640
633
641
keyManager . onKeydown ( fakeKeyEvents . downArrow ) ;
634
642
keyManager . onKeydown ( fakeKeyEvents . downArrow ) ;
@@ -706,6 +714,7 @@ describe('Key managers', () => {
706
714
const items = itemList . toArray ( ) ;
707
715
items . forEach ( item => ( item . disabled = true ) ) ;
708
716
itemList . reset ( items ) ;
717
+ itemList . notifyOnChanges ( ) ;
709
718
710
719
keyManager . onKeydown ( fakeKeyEvents . downArrow ) ;
711
720
} ) ;
@@ -730,6 +739,7 @@ describe('Key managers', () => {
730
739
const items = itemList . toArray ( ) ;
731
740
items [ 1 ] . disabled = true ;
732
741
itemList . reset ( items ) ;
742
+ itemList . notifyOnChanges ( ) ;
733
743
734
744
expect ( keyManager . activeItemIndex ) . toBe ( 0 ) ;
735
745
@@ -744,6 +754,7 @@ describe('Key managers', () => {
744
754
const items = itemList . toArray ( ) ;
745
755
items [ 1 ] . skipItem = true ;
746
756
itemList . reset ( items ) ;
757
+ itemList . notifyOnChanges ( ) ;
747
758
748
759
expect ( keyManager . activeItemIndex ) . toBe ( 0 ) ;
749
760
@@ -839,6 +850,7 @@ describe('Key managers', () => {
839
850
new FakeFocusable ( 'две' ) ,
840
851
new FakeFocusable ( 'три' ) ,
841
852
] ) ;
853
+ itemList . notifyOnChanges ( ) ;
842
854
843
855
const keyboardEvent = createKeyboardEvent ( 'keydown' , 68 , 'д' ) ;
844
856
@@ -854,6 +866,7 @@ describe('Key managers', () => {
854
866
new FakeFocusable ( '321' ) ,
855
867
new FakeFocusable ( '`!?' ) ,
856
868
] ) ;
869
+ itemList . notifyOnChanges ( ) ;
857
870
858
871
keyManager . onKeydown ( createKeyboardEvent ( 'keydown' , 192 , '`' ) ) ; // types "`"
859
872
tick ( debounceInterval ) ;
@@ -874,6 +887,7 @@ describe('Key managers', () => {
874
887
const items = itemList . toArray ( ) ;
875
888
items [ 0 ] . disabled = true ;
876
889
itemList . reset ( items ) ;
890
+ itemList . notifyOnChanges ( ) ;
877
891
878
892
keyManager . onKeydown ( createKeyboardEvent ( 'keydown' , 79 , 'o' ) ) ; // types "o"
879
893
tick ( debounceInterval ) ;
@@ -889,6 +903,7 @@ describe('Key managers', () => {
889
903
new FakeFocusable ( 'Boromir' ) ,
890
904
new FakeFocusable ( 'Aragorn' ) ,
891
905
] ) ;
906
+ itemList . notifyOnChanges ( ) ;
892
907
893
908
keyManager . setActiveItem ( 1 ) ;
894
909
keyManager . onKeydown ( createKeyboardEvent ( 'keydown' , 66 , 'b' ) ) ;
@@ -905,6 +920,7 @@ describe('Key managers', () => {
905
920
new FakeFocusable ( 'Boromir' ) ,
906
921
new FakeFocusable ( 'Aragorn' ) ,
907
922
] ) ;
923
+ itemList . notifyOnChanges ( ) ;
908
924
909
925
keyManager . setActiveItem ( 3 ) ;
910
926
keyManager . onKeydown ( createKeyboardEvent ( 'keydown' , 66 , 'b' ) ) ;
0 commit comments