fix: ability to fetch separators by id (#15299)
This commit is contained in:
parent
9349b0a273
commit
02cd96875d
2 changed files with 29 additions and 3 deletions
|
@ -570,6 +570,26 @@ describe('Menu module', () => {
|
|||
const fsc = menu.getMenuItemById('fullScreen')
|
||||
assert.equal(menu.items[0].submenu.items[0], fsc)
|
||||
})
|
||||
|
||||
it('should return the separator with the given id', () => {
|
||||
const menu = Menu.buildFromTemplate([
|
||||
{
|
||||
label: 'Item 1',
|
||||
id: 'item_1'
|
||||
},
|
||||
{
|
||||
id: 'separator',
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: 'Item 2',
|
||||
id: 'item_2'
|
||||
}
|
||||
])
|
||||
const separator = menu.getMenuItemById('separator')
|
||||
assert.equal(typeof separator, 'object')
|
||||
assert.equal(separator, menu.items[1])
|
||||
})
|
||||
})
|
||||
|
||||
describe('Menu.insert', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue