@@ -276,13 +276,21 @@ describe('hotkey', function () {
276276 [ 'S' , { key : 'S' , shiftKey : true , code : 'KeyS' } ] ,
277277 [ '!' , { key : '!' , shiftKey : true , code : 'KeyS' } ] ,
278278 [ 'Control+Shift' , { ctrlKey : true , shiftKey : true , key : 'Shift' } ] ,
279- [ 'Control+Shift' , { ctrlKey : true , shiftKey : true , key : 'Control' } ]
279+ [ 'Control+Shift' , { ctrlKey : true , shiftKey : true , key : 'Control' } ] ,
280+ [ 'Alt+s' , { altKey : true , key : 's' } ] ,
281+ [ 'Alt+s' , { altKey : true , key : 'ß' } , 'mac' ] ,
282+ [ 'Alt+Shift+S' , { altKey : true , shiftKey : true , key : 'S' } ] ,
283+ [ 'Alt+Shift+S' , { altKey : true , shiftKey : true , key : 'Í' } , 'mac' ] ,
284+ [ 'Alt+ArrowLeft' , { altKey : true , key : 'ArrowLeft' } ] ,
285+ [ 'Alt+ArrowLeft' , { altKey : true , key : 'ArrowLeft' } , 'mac' ] ,
286+ [ 'Alt+Shift+ArrowLeft' , { altKey : true , shiftKey : true , key : 'ArrowLeft' } ] ,
287+ [ 'Alt+Shift+ArrowLeft' , { altKey : true , shiftKey : true , key : 'ArrowLeft' } , 'mac' ]
280288 ]
281- for ( const [ expected , keyEvent ] of tests ) {
289+ for ( const [ expected , keyEvent , platform = 'win / linux' ] of tests ) {
282290 it ( `${ JSON . stringify ( keyEvent ) } => ${ expected } ` , function ( done ) {
283291 document . body . addEventListener ( 'keydown' , function handler ( event ) {
284292 document . body . removeEventListener ( 'keydown' , handler )
285- assert . equal ( eventToHotkeyString ( event ) , expected )
293+ assert . equal ( eventToHotkeyString ( event , platform ) , expected )
286294 done ( )
287295 } )
288296 document . body . dispatchEvent ( new KeyboardEvent ( 'keydown' , keyEvent ) )
0 commit comments