Use Menu.buildFromTemplate instead of raw menu APIs.

This commit is contained in:
Cheng Zhao 2013-08-14 21:49:13 +08:00
parent 5189caa610
commit b39df5ea87

View file

@ -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