mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Throw error when adding context menu with invalid selector
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user