Use Menu.buildFromTemplate instead of raw menu APIs.
This commit is contained in:
parent
5189caa610
commit
b39df5ea87
1 changed files with 3 additions and 4 deletions
|
@ -26,12 +26,11 @@ describe 'Menu API', ->
|
||||||
|
|
||||||
describe 'MenuItem.click', ->
|
describe 'MenuItem.click', ->
|
||||||
it 'should be called with the item object passed', (done) ->
|
it 'should be called with the item object passed', (done) ->
|
||||||
menu = new Menu
|
menu = Menu.buildFromTemplate [
|
||||||
menuItem = new MenuItem
|
|
||||||
label: 'text'
|
label: 'text'
|
||||||
click: (item) ->
|
click: (item) ->
|
||||||
assert.equal item.constructor.name, 'MenuItem'
|
assert.equal item.constructor.name, 'MenuItem'
|
||||||
assert.equal item.label, 'text'
|
assert.equal item.label, 'text'
|
||||||
done()
|
done()
|
||||||
menu.append menuItem
|
]
|
||||||
menu.delegate.executeCommand menuItem.commandId
|
menu.delegate.executeCommand menu.items[0].commandId
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue