Skip to content

Commit

Permalink
Add unit test. Cannot seem to run locally because of nodegit but will…
Browse files Browse the repository at this point in the history
… see what happens in CI.
  • Loading branch information
bolinfest committed Jan 19, 2016
1 parent 3d5386e commit 0a48176
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions spec/context-menu-manager-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,30 @@ describe "ContextMenuManager", ->
catch error
addError = error
expect(addError.message).toContain('<>')

it "recursively applies templateForEvent on submenu items", ->
created = (event) -> @label = 'D'
item = {
label: 'A',
command: 'B',
submenu: [
{
label: 'C',
created,
}
]
}
contextMenu.add('.grandchild': [item])

dispatchedEvent = {target: grandchild}
expect(contextMenu.templateForEvent(dispatchedEvent)).toEqual(
[
label: 'A',
command: 'B',
submenu: [
{
label: 'D',
created,
}
]
])

0 comments on commit 0a48176

Please sign in to comment.