[Inspector] Add test

Added a test to the browse object controller to
regain 100% coverage. Tests initilization of
ngModel properties. #73.
This commit is contained in:
slhale 2015-08-26 10:50:33 -07:00
parent 05fb7173aa
commit 7a69bffb4a

View File

@ -102,6 +102,22 @@ define(
.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();
});
});
}
);