preserve custom properties passed to MenuItem constructor
This commit is contained in:
parent
018575de71
commit
16b3962b66
2 changed files with 22 additions and 15 deletions
|
@ -430,3 +430,23 @@ describe('menu module', function () {
|
|||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('MenuItem with custom properties in constructor', function () {
|
||||
it('preserves the custom properties', function () {
|
||||
var template = [{
|
||||
label: 'menu 1',
|
||||
customProp: 'foo',
|
||||
submenu: []
|
||||
}]
|
||||
|
||||
var menu = new Menu.buildFromTemplate(template)
|
||||
menu.items[0].submenu.append(new MenuItem({
|
||||
label: 'item 1',
|
||||
customProp: 'bar'
|
||||
}))
|
||||
|
||||
assert.equal(menu.items[0].customProp, 'foo')
|
||||
assert.equal(menu.items[0].submenu.items[0].label, 'item 1')
|
||||
assert.equal(menu.items[0].submenu.items[0].customProp, 'bar')
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue