[About] Add tests for controllers
Add tests for controllers introduced to support a minimal implementation of an About dialog, WTD-667.
This commit is contained in:
32
platform/commonUI/about/test/LogoControllerSpec.js
Normal file
32
platform/commonUI/about/test/LogoControllerSpec.js
Normal file
@@ -0,0 +1,32 @@
|
||||
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
|
||||
|
||||
define(
|
||||
['../src/LogoController'],
|
||||
function (LogoController) {
|
||||
"use strict";
|
||||
|
||||
describe("The About controller", function () {
|
||||
var mockOverlayService,
|
||||
controller;
|
||||
|
||||
beforeEach(function () {
|
||||
mockOverlayService = jasmine.createSpyObj(
|
||||
"overlayService",
|
||||
["createOverlay"]
|
||||
);
|
||||
controller = new LogoController(mockOverlayService);
|
||||
});
|
||||
|
||||
it("shows the about dialog", function () {
|
||||
//Verify precondition
|
||||
expect(mockOverlayService.createOverlay)
|
||||
.not.toHaveBeenCalled();
|
||||
controller.showAboutDialog();
|
||||
expect(mockOverlayService.createOverlay)
|
||||
.toHaveBeenCalledWith("overlay-about");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user