Skip to content

Commit

Permalink
Added spec for menu accelerator
Browse files Browse the repository at this point in the history
  • Loading branch information
nitsakh committed Oct 20, 2018
1 parent f3f44bf commit 169a268
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions spec/api-menu-spec.js
Expand Up @@ -721,5 +721,28 @@ describe('Menu module', () => {
Menu.setApplicationMenu(null)
expect(Menu.getApplicationMenu()).to.be.null()
})

it('provides working menu accelerators', (done) => {
const menu = Menu.buildFromTemplate([
{
label: 'Test',
submenu: [
{
label: 'Test Item',
accelerator: 'Ctrl+T',
click: () => {
// Test will succeed, only when the menu accelerator action
// is triggered
done()
},
id: 'test'
}
]
}
])
Menu.setApplicationMenu(menu)
expect(Menu.getApplicationMenu()).to.not.be.null()
require('robotjs').keyTap('t', 'control')
})
})
})

0 comments on commit 169a268

Please sign in to comment.