From: Cheng Zhao Date: Wed, 14 Aug 2013 04:51:37 +0000 (+0800) Subject: Add spec for MenuItem.click. X-Git-Tag: v0.3.3~11 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=f267a7812f84c0b496078626bbe6ca2d15c33f1c;p=electron.git Add spec for MenuItem.click. --- diff --git a/spec/api/menu.coffee b/spec/api/menu.coffee index fea26811..c0551a69 100644 --- a/spec/api/menu.coffee +++ b/spec/api/menu.coffee @@ -23,3 +23,15 @@ describe 'Menu API', -> assert.equal menu.items[1].label, 'inserted' assert.equal menu.items[2].label, '2' assert.equal menu.items[3].label, '3' + + describe 'MenuItem.click', -> + it 'should be called with the item object passed', (done) -> + menu = new Menu + menuItem = new MenuItem + label: 'text' + click: (item) -> + assert.equal item.constructor.name, 'MenuItem' + assert.equal item.label, 'text' + done() + menu.append menuItem + menu.delegate.executeCommand menuItem.commandId