mirror of
https://github.com/nasa/openmct.git
synced 2024-12-24 07:16:39 +00:00
0bacc03e58
Fix FullscreenActionSpec such that it will execute on command line; the global screenfull dependency behaves differently during attempts to spy on methods from the command line build, so replace it entirely. Concludes work on WTD-574 in preparation to submit for review.
41 lines
1.2 KiB
JavaScript
41 lines
1.2 KiB
JavaScript
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine,afterEach,window*/
|
|
|
|
/**
|
|
* MCTRepresentationSpec. Created by vwoeltje on 11/6/14.
|
|
*/
|
|
define(
|
|
["../../src/windowing/FullscreenAction"],
|
|
function (FullscreenAction) {
|
|
"use strict";
|
|
|
|
describe("The fullscreen action", function () {
|
|
var action,
|
|
oldScreenfull;
|
|
|
|
beforeEach(function () {
|
|
// Screenfull is not shimmed or injected, so
|
|
// we need to spy on it in the global scope.
|
|
oldScreenfull = window.screenfull;
|
|
|
|
window.screenfull = {};
|
|
window.screenfull.toggle = jasmine.createSpy("toggle");
|
|
|
|
action = new FullscreenAction({});
|
|
});
|
|
|
|
afterEach(function () {
|
|
window.screenfull = oldScreenfull;
|
|
});
|
|
|
|
it("toggles fullscreen mode when performed", function () {
|
|
action.perform();
|
|
expect(window.screenfull.toggle).toHaveBeenCalled();
|
|
});
|
|
|
|
it("provides displayable metadata", function () {
|
|
expect(action.getMetadata().glyph).toBeDefined();
|
|
});
|
|
|
|
});
|
|
}
|
|
); |