Throw error when adding context menu with invalid selector

This commit is contained in:
Kevin Sawicki
2015-03-03 14:52:18 -08:00
parent 2a12f7779d
commit 5902bc42e9
2 changed files with 12 additions and 0 deletions

View File

@@ -151,6 +151,14 @@ describe "ContextMenuManager", ->
shouldDisplay = false
expect(contextMenu.templateForEvent(dispatchedEvent)).toEqual []
it "throws an error when the selector is invalid", ->
addError = null
try
contextMenu.add '<>': [{label: 'A', command: 'a'}]
catch error
addError = error
expect(addError.message).toContain('<>')
describe "when the menus are specified in a legacy format", ->
beforeEach ->
jasmine.snapshotDeprecations()