Suppress deprecations while testing legacy code path
Esse commit está contido em:
@@ -151,24 +151,31 @@ describe "ContextMenuManager", ->
|
|||||||
shouldDisplay = false
|
shouldDisplay = false
|
||||||
expect(contextMenu.templateForEvent(dispatchedEvent)).toEqual []
|
expect(contextMenu.templateForEvent(dispatchedEvent)).toEqual []
|
||||||
|
|
||||||
it "allows items to be specified in the legacy format for now", ->
|
describe "when the menus are specified in a legacy format", ->
|
||||||
contextMenu.add '.parent':
|
beforeEach ->
|
||||||
'A': 'a'
|
jasmine.snapshotDeprecations()
|
||||||
'Separator 1': '-'
|
|
||||||
'B':
|
|
||||||
'C': 'c'
|
|
||||||
'Separator 2': '-'
|
|
||||||
'D': 'd'
|
|
||||||
|
|
||||||
expect(contextMenu.templateForElement(parent)).toEqual [
|
afterEach ->
|
||||||
{label: 'A', command: 'a'}
|
jasmine.restoreDeprecationsSnapshot()
|
||||||
{type: 'separator'}
|
|
||||||
{
|
it "allows items to be specified in the legacy format for now", ->
|
||||||
label: 'B'
|
contextMenu.add '.parent':
|
||||||
submenu: [
|
'A': 'a'
|
||||||
{label: 'C', command: 'c'}
|
'Separator 1': '-'
|
||||||
{type: 'separator'}
|
'B':
|
||||||
{label: 'D', command: 'd'}
|
'C': 'c'
|
||||||
]
|
'Separator 2': '-'
|
||||||
}
|
'D': 'd'
|
||||||
]
|
|
||||||
|
expect(contextMenu.templateForElement(parent)).toEqual [
|
||||||
|
{label: 'A', command: 'a'}
|
||||||
|
{type: 'separator'}
|
||||||
|
{
|
||||||
|
label: 'B'
|
||||||
|
submenu: [
|
||||||
|
{label: 'C', command: 'c'}
|
||||||
|
{type: 'separator'}
|
||||||
|
{label: 'D', command: 'd'}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|||||||
Referência em uma Nova Issue
Bloquear um usuário