mirror of
https://github.com/nasa/openmct.git
synced 2024-12-22 06:27:48 +00:00
54c075dc88
Reorganize folder strucutre for tests in bundle platform/commonUI/general; source folder structure has been modified to accommodate additional classes added to support autoflow tabular views, WTD-614, so test folder needs to be reorganized accordingly
43 lines
1.5 KiB
JavaScript
43 lines
1.5 KiB
JavaScript
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
|
|
|
|
define(
|
|
["../../src/controllers/ToggleController"],
|
|
function (ToggleController) {
|
|
"use strict";
|
|
|
|
describe("The toggle controller", function () {
|
|
var controller;
|
|
|
|
beforeEach(function () {
|
|
controller = new ToggleController();
|
|
});
|
|
|
|
it("is initially inactive", function () {
|
|
expect(controller.isActive()).toBe(false);
|
|
});
|
|
|
|
it("tracks enabled/disabled state when toggled", function () {
|
|
controller.toggle();
|
|
expect(controller.isActive()).toBe(true);
|
|
controller.toggle();
|
|
expect(controller.isActive()).toBe(false);
|
|
controller.toggle();
|
|
expect(controller.isActive()).toBe(true);
|
|
controller.toggle();
|
|
expect(controller.isActive()).toBe(false);
|
|
});
|
|
|
|
it("allows active state to be explictly specified", function () {
|
|
controller.setState(true);
|
|
expect(controller.isActive()).toBe(true);
|
|
controller.setState(true);
|
|
expect(controller.isActive()).toBe(true);
|
|
controller.setState(false);
|
|
expect(controller.isActive()).toBe(false);
|
|
controller.setState(false);
|
|
expect(controller.isActive()).toBe(false);
|
|
});
|
|
|
|
});
|
|
}
|
|
); |