Skip to content

Commit

Permalink
mine CI for mac accelerators
Browse files Browse the repository at this point in the history
  • Loading branch information
brenca committed Oct 30, 2018
1 parent 880b9bb commit 51ae862
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion spec/api-menu-item-spec.js
Expand Up @@ -395,9 +395,20 @@ describe('MenuItems', () => {
const menu = Menu.buildFromTemplate([
{ label: 'text', accelerator: 'CmdOrCtrl+A' },
{ label: 'text', accelerator: 'Shift+A' },
{ label: 'text', accelerator: 'Alt+A' }
{ label: 'text', accelerator: 'Alt+A' },
{ label: 'text', accelerator: 'CmdOrCtrl+Tab' },
{ label: 'text', accelerator: 'Shift+Tab' },
{ label: 'text', accelerator: 'Alt+Tab' },
{ label: 'text', accelerator: 'Control+Shift+=' },
{ label: 'text', accelerator: 'Control+Plus' }
])

const t = (x) => {
return menu.getAcceleratorTextAt(x)
}

assert.strictEqual(`${t(0)} ${t(1)} ${t(2)} ${t(3)} ${t(4)} ${t(5) ${t(6)} ${t(7)}}`, `lolfail`)

assert.strictEqual(menu.getAcceleratorTextAt(0),
`${(process.platform === 'darwin') ? 'Cmd' : 'Ctrl'}+A`)
assert.strictEqual(menu.getAcceleratorTextAt(1), 'Shift+A')
Expand Down

0 comments on commit 51ae862

Please sign in to comment.