Move MenuItem spec into root describe
This commit is contained in:
parent
55f90b4a4b
commit
947556a23f
1 changed files with 18 additions and 18 deletions
|
@ -429,26 +429,26 @@ describe('menu module', function () {
|
||||||
assert.equal(item.getDefaultRoleAccelerator(), process.platform === 'win32' ? 'Control+Y' : 'Shift+CommandOrControl+Z')
|
assert.equal(item.getDefaultRoleAccelerator(), process.platform === 'win32' ? 'Control+Y' : 'Shift+CommandOrControl+Z')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
|
||||||
|
|
||||||
describe('MenuItem with custom properties in constructor', function () {
|
describe('MenuItem with custom properties in constructor', function () {
|
||||||
it('preserves the custom properties', function () {
|
it('preserves the custom properties', function () {
|
||||||
var template = [{
|
var template = [{
|
||||||
label: 'menu 1',
|
label: 'menu 1',
|
||||||
customProp: 'foo',
|
customProp: 'foo',
|
||||||
submenu: []
|
submenu: []
|
||||||
}]
|
}]
|
||||||
|
|
||||||
var menu = Menu.buildFromTemplate(template)
|
var menu = Menu.buildFromTemplate(template)
|
||||||
menu.items[0].submenu.append(new MenuItem({
|
menu.items[0].submenu.append(new MenuItem({
|
||||||
label: 'item 1',
|
label: 'item 1',
|
||||||
customProp: 'bar',
|
customProp: 'bar',
|
||||||
overrideProperty: 'oops not allowed'
|
overrideProperty: 'oops not allowed'
|
||||||
}))
|
}))
|
||||||
|
|
||||||
assert.equal(menu.items[0].customProp, 'foo')
|
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].label, 'item 1')
|
||||||
assert.equal(menu.items[0].submenu.items[0].customProp, 'bar')
|
assert.equal(menu.items[0].submenu.items[0].customProp, 'bar')
|
||||||
assert.equal(typeof menu.items[0].submenu.items[0].overrideProperty, 'function')
|
assert.equal(typeof menu.items[0].submenu.items[0].overrideProperty, 'function')
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue