2019-11-02 00:06:25 +01:00
const ui = zrequire ( 'ui' ) ;
2018-07-21 02:19:14 +02:00
set _global ( 'i18n' , global . stub _i18n ) ;
2018-09-20 10:17:51 +02:00
set _global ( 'navigator' , {
userAgent : '' ,
} ) ;
2018-07-21 02:19:14 +02:00
run _test ( 'get_hotkey_deprecation_notice' , ( ) => {
2019-11-02 00:06:25 +01:00
const expected = 'translated: We\'ve replaced the "*" hotkey with "Ctrl + s" to make this common shortcut easier to trigger.' ;
const actual = ui . get _hotkey _deprecation _notice ( '*' , 'Ctrl + s' ) ;
2018-07-21 02:19:14 +02:00
assert . equal ( expected , actual ) ;
} ) ;
2018-09-20 10:17:51 +02:00
run _test ( 'get_hotkey_deprecation_notice_mac' , ( ) => {
global . navigator . userAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36" ;
2019-11-02 00:06:25 +01:00
const expected = 'translated: We\'ve replaced the "*" hotkey with "Cmd + s" to make this common shortcut easier to trigger.' ;
const actual = ui . get _hotkey _deprecation _notice ( '*' , 'Cmd + s' ) ;
2018-09-20 10:17:51 +02:00
assert . equal ( expected , actual ) ;
// Reset userAgent
global . navigator . userAgent = '' ;
} ) ;