From 51b8c0292c49c22585a6a9d2f087cdb0901fc87b Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 21 Jun 2016 16:02:15 -0700 Subject: [PATCH] Add spec for submenu type with no submenu --- spec/api-menu-spec.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spec/api-menu-spec.js b/spec/api-menu-spec.js index a9cf51189325..db897cafdc65 100644 --- a/spec/api-menu-spec.js +++ b/spec/api-menu-spec.js @@ -372,4 +372,17 @@ describe('menu module', function () { }, /Unknown menu item type: not-a-type/) }) }) + + describe('MenuItem with submenu type and missing submenu', function () { + it('throws an exception', function () { + assert.throws(function () { + var menu = Menu.buildFromTemplate([ + { + label: 'text', + type: 'submenu' + } + ]) + }, /Invalid submenu/) + }) + }) })