Example #1
0
 it('should handle platform specific modifiers', () => {
   let stroke = '';
   if (Platform.IS_MAC) {
     stroke = CommandRegistry.normalizeKeystroke('Cmd S');
     expect(stroke).to.equal('Cmd S');
     stroke = CommandRegistry.normalizeKeystroke('Accel S');
     expect(stroke).to.equal('Cmd S');
   } else {
     stroke = CommandRegistry.normalizeKeystroke('Cmd S');
     expect(stroke).to.equal('S');
     stroke = CommandRegistry.normalizeKeystroke('Accel S');
     expect(stroke).to.equal('Ctrl S');
   }
 });
Example #2
0
 it('should handle multiple modifiers', () => {
   let stroke = CommandRegistry.normalizeKeystroke('Ctrl Shift Alt S');
   expect(stroke).to.equal('Ctrl Alt Shift S');
 });
Example #3
0
 it('should normalize and validate a keystroke', () => {
   let stroke = CommandRegistry.normalizeKeystroke('Ctrl S');
   expect(stroke).to.equal('Ctrl S');
 });