@@ -794,29 +794,40 @@ describe("FIXME: Key shortcut click highlighting too many event listeners bug",
794794 // FIXME: there’s lots of event listeners being created!
795795 const input = document . createElement ( 'input' ) ;
796796 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+ } ) ;
800801
801802 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+ } ) ;
804807
805808 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+ } ) ;
808813
809814 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+ } ) ;
812819
813820 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+ } ) ;
816825
817826 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+ } ) ;
820831
821832 machine . abort ( ) ;
822833 } ) ;
0 commit comments