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', ->
|
||||
it 'should be called with the item object passed', (done) ->
|
||||
menu = new Menu
|
||||
menuItem = new MenuItem
|
||||
menu = Menu.buildFromTemplate [
|
||||
label: 'text'
|
||||
click: (item) ->
|
||||
assert.equal item.constructor.name, 'MenuItem'
|
||||
assert.equal item.label, 'text'
|
||||
done()
|
||||
menu.append menuItem
|
||||
menu.delegate.executeCommand menuItem.commandId
|
||||
]
|
||||
menu.delegate.executeCommand menu.items[0].commandId
|
||||
|
|
Loading…
Reference in a new issue