Files
atom/spec/stdlib/native-spec.coffee
Nathan Sobo 00bccdca96 Add partial implementation Native.addMenuItem.
It takes a path like "Menu 1 > Menu 2 > Item", and builds a series of submenus if needed along that path, then adds the final item at its terminus. Specs still need to be fleshed out further.
2011-12-23 16:45:04 -06:00

22 lines
514 B
CoffeeScript

Native = require 'native'
describe "Native", ->
nativeModule = null
beforeEach ->
nativeModule = new Native
fdescribe "addMenuItem(path, keyBinding)", ->
mainMenuItems = null
beforeEach ->
mainMenuItems = OSX.NSApp.mainMenu.itemArray
it "adds the item at the path terminus to the main menu, adding submenus as needed", ->
initialMenuCount = mainMenuItems.length
nativeModule.addMenuItem('Submenu > Item')
expect(mainMenuItems.length).toBe initialMenuCount + 1