From 9cec02420cb2629bd95055166ae55afed3f21652 Mon Sep 17 00:00:00 2001 From: Ben Ogle Date: Tue, 25 Nov 2014 16:21:07 -0800 Subject: [PATCH] Suppress deprecations while testing legacy code path --- spec/context-menu-manager-spec.coffee | 47 +++++++++++++++------------ 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/spec/context-menu-manager-spec.coffee b/spec/context-menu-manager-spec.coffee index 6c109e7d0..1c3c1f21a 100644 --- a/spec/context-menu-manager-spec.coffee +++ b/spec/context-menu-manager-spec.coffee @@ -151,24 +151,31 @@ describe "ContextMenuManager", -> shouldDisplay = false expect(contextMenu.templateForEvent(dispatchedEvent)).toEqual [] - it "allows items to be specified in the legacy format for now", -> - contextMenu.add '.parent': - 'A': 'a' - 'Separator 1': '-' - 'B': - 'C': 'c' - 'Separator 2': '-' - 'D': 'd' + describe "when the menus are specified in a legacy format", -> + beforeEach -> + jasmine.snapshotDeprecations() - expect(contextMenu.templateForElement(parent)).toEqual [ - {label: 'A', command: 'a'} - {type: 'separator'} - { - label: 'B' - submenu: [ - {label: 'C', command: 'c'} - {type: 'separator'} - {label: 'D', command: 'd'} - ] - } - ] + afterEach -> + jasmine.restoreDeprecationsSnapshot() + + it "allows items to be specified in the legacy format for now", -> + contextMenu.add '.parent': + 'A': 'a' + 'Separator 1': '-' + 'B': + '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'} + ] + } + ]