@@ -794,29 +794,40 @@ describe("FIXME: Key shortcut click highlighting too many event listeners bug",
794
794
// FIXME: there’s lots of event listeners being created!
795
795
const input = document . createElement ( 'input' ) ;
796
796
const machine = start ( KeyShortcutListener . bind ( null , input ) ) ;
797
-
798
- expect ( machine . current ) . toEqual ( "Closed" ) ;
799
- expect ( machine . changeCount ) . toEqual ( 0 ) ;
797
+ expect ( machine . value ) . toMatchObject ( {
798
+ state : "Closed" ,
799
+ change : 0 ,
800
+ } ) ;
800
801
801
802
input . dispatchEvent ( new KeyboardEvent ( 'keydown' , { key : 'Enter' } ) ) ;
802
- expect ( machine . current ) . toEqual ( "Open" ) ;
803
- expect ( machine . changeCount ) . toEqual ( 2 ) ;
803
+ expect ( machine . value ) . toMatchObject ( {
804
+ state : "Open" ,
805
+ change : 2 ,
806
+ } ) ;
804
807
805
808
input . dispatchEvent ( new KeyboardEvent ( 'keydown' , { key : 'Enter' } ) ) ;
806
- expect ( machine . current ) . toEqual ( "Open" ) ;
807
- expect ( machine . changeCount ) . toEqual ( 6 ) ;
809
+ expect ( machine . value ) . toMatchObject ( {
810
+ state : "Open" ,
811
+ change : 6 ,
812
+ } ) ;
808
813
809
814
input . dispatchEvent ( new KeyboardEvent ( 'keydown' , { key : 'a' } ) ) ;
810
- expect ( machine . current ) . toEqual ( "Open" ) ;
811
- expect ( machine . changeCount ) . toEqual ( 14 ) ;
815
+ expect ( machine . value ) . toMatchObject ( {
816
+ state : "Open" ,
817
+ change : 14 ,
818
+ } ) ;
812
819
813
820
input . dispatchEvent ( new KeyboardEvent ( 'keydown' , { key : 'Escape' } ) ) ;
814
- expect ( machine . current ) . toEqual ( "Closed" ) ;
815
- expect ( machine . changeCount ) . toEqual ( 30 ) ;
821
+ expect ( machine . value ) . toMatchObject ( {
822
+ state : "Closed" ,
823
+ change : 30 ,
824
+ } ) ;
816
825
817
826
input . dispatchEvent ( new KeyboardEvent ( 'keydown' , { key : 'a' } ) ) ;
818
- expect ( machine . current ) . toEqual ( "Closed" ) ;
819
- expect ( machine . changeCount ) . toEqual ( 62 ) ;
827
+ expect ( machine . value ) . toMatchObject ( {
828
+ state : "Closed" ,
829
+ change : 62 ,
830
+ } ) ;
820
831
821
832
machine . abort ( ) ;
822
833
} ) ;
0 commit comments