openmct/platform/commonUI/browse/test/windowing/FullscreenActionSpec.js
Victor Woeltjen 52ec1aeb89 [Common UI] Complete remaining specs
Complete remaining specs to achieve full test coverage
for common user interface bundles being transitioned
as part of WTD-574.
2014-11-25 22:48:12 -08:00

40 lines
1.1 KiB
JavaScript

/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine,afterEach,screenfull*/
/**
* MCTRepresentationSpec. Created by vwoeltje on 11/6/14.
*/
define(
["../../src/windowing/FullscreenAction"],
function (FullscreenAction) {
"use strict";
describe("The fullscreen action", function () {
var action,
oldToggle;
beforeEach(function () {
// Screenfull is not shimmed or injected, so
// we need to spy on it in the global scope.
oldToggle = screenfull.toggle;
screenfull.toggle = jasmine.createSpy("toggle");
action = new FullscreenAction({});
});
afterEach(function () {
screenfull.toggle = oldToggle;
});
it("toggles fullscreen mode when performed", function () {
action.perform();
expect(screenfull.toggle).toHaveBeenCalled();
});
it("provides displayable metadata", function () {
expect(action.getMetadata().glyph).toBeDefined();
});
});
}
);