mirror of
https://github.com/atom/atom.git
synced 2026-02-11 07:05:11 -05:00
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.
22 lines
514 B
CoffeeScript
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
|
|
|