@@ -158,11 +158,15 @@ describe('useRootClose', () => {
158158
159159 expect ( spy ) . to . not . have . been . called ;
160160
161- simulant . fire ( document . body , 'keyup' , { keyCode : escapeKeyCode } ) ;
161+ simulant . fire ( document . body , 'keyup' , {
162+ code : 'Escape' ,
163+ keyCode : escapeKeyCode ,
164+ } ) ;
162165
163166 expect ( spy ) . to . have . been . calledOnce ;
164167
165168 expect ( spy . getCall ( 0 ) . args . length ) . to . be . equal ( 1 ) ;
169+ expect ( spy . getCall ( 0 ) . args [ 0 ] . code ) . to . be . equal ( 'Escape' ) ;
166170 expect ( spy . getCall ( 0 ) . args [ 0 ] . keyCode ) . to . be . equal ( escapeKeyCode ) ;
167171 expect ( spy . getCall ( 0 ) . args [ 0 ] . type ) . to . be . equal ( 'keyup' ) ;
168172 } ) ;
@@ -182,13 +186,17 @@ describe('useRootClose', () => {
182186 </ Wrapper > ,
183187 ) ;
184188
185- simulant . fire ( document . body , 'keyup' , { keyCode : escapeKeyCode } ) ;
189+ simulant . fire ( document . body , 'keyup' , {
190+ code : 'Escape' ,
191+ keyCode : escapeKeyCode ,
192+ } ) ;
186193
187194 // TODO: Update to match expectations.
188195 // expect(outerSpy).to.have.not.been.called;
189196 expect ( innerSpy ) . to . have . been . calledOnce ;
190197
191198 expect ( innerSpy . getCall ( 0 ) . args . length ) . to . be . equal ( 1 ) ;
199+ expect ( innerSpy . getCall ( 0 ) . args [ 0 ] . code ) . to . be . equal ( 'Escape' ) ;
192200 expect ( innerSpy . getCall ( 0 ) . args [ 0 ] . keyCode ) . to . be . equal ( escapeKeyCode ) ;
193201 expect ( innerSpy . getCall ( 0 ) . args [ 0 ] . type ) . to . be . equal ( 'keyup' ) ;
194202 } ) ;
0 commit comments