From 7a69bffb4aa14cf4a27eeb605d50df48b6a4984b Mon Sep 17 00:00:00 2001 From: slhale Date: Wed, 26 Aug 2015 10:50:33 -0700 Subject: [PATCH] [Inspector] Add test Added a test to the browse object controller to regain 100% coverage. Tests initilization of ngModel properties. #73. --- .../browse/test/BrowseObjectControllerSpec.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/platform/commonUI/browse/test/BrowseObjectControllerSpec.js b/platform/commonUI/browse/test/BrowseObjectControllerSpec.js index f20b858e2d..7ccd809f96 100644 --- a/platform/commonUI/browse/test/BrowseObjectControllerSpec.js +++ b/platform/commonUI/browse/test/BrowseObjectControllerSpec.js @@ -101,7 +101,23 @@ define( expect(mockScope.representation.selected) .toEqual(testViews[1]); }); - + + it("sets ngModel properties on initialization", function () { + // Left pane open status depends on how the window was opened + // Case 1: undefined opener + expect(mockWindow.opener).not.toBeDefined(); + expect(mockScope.ngModel.leftPane).toBeTruthy(); + + // Case 2: defined opener + mockWindow.opener = {}; + controller = new BrowseObjectController( + mockScope, + mockLocation, + mockRoute, + mockWindow + ); + expect(mockScope.ngModel.leftPane).toBeFalsy(); + }); }); } );