add unit test for getMenuItemById
This commit is contained in:
parent
f49f7d65a5
commit
3c6a7c332a
1 changed files with 23 additions and 0 deletions
|
@ -195,6 +195,29 @@ describe('menu module', function () {
|
|||
})
|
||||
})
|
||||
|
||||
describe('Menu.getMenuItemById', function () {
|
||||
it('should return the item with the given id', function () {
|
||||
var menu = Menu.buildFromTemplate([
|
||||
{
|
||||
label: 'View',
|
||||
submenu: [
|
||||
{
|
||||
label: 'Enter Fullscreen',
|
||||
accelerator: 'Control+Command+F',
|
||||
id: 'fullScreen'
|
||||
},
|
||||
{
|
||||
label: 'Exit Fullscreen',
|
||||
accelerator: 'Control+Command+F'
|
||||
}
|
||||
]
|
||||
}
|
||||
])
|
||||
const fsc = menu.getMenuItemById('fullScreen')
|
||||
assert.equal(menu.items[0].submenu.items[0], fsc)
|
||||
})
|
||||
})
|
||||
|
||||
describe('Menu.insert', function () {
|
||||
it('should store item in @items by its index', function () {
|
||||
var menu = Menu.buildFromTemplate([
|
||||
|
|
Loading…
Reference in a new issue