2014-11-26 07:08:47 +00:00
|
|
|
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine,afterEach,window*/
|
2014-11-26 02:30:30 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* MCTRepresentationSpec. Created by vwoeltje on 11/6/14.
|
|
|
|
*/
|
|
|
|
define(
|
|
|
|
["../../src/windowing/FullscreenAction"],
|
|
|
|
function (FullscreenAction) {
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
describe("The fullscreen action", function () {
|
2014-11-26 06:48:12 +00:00
|
|
|
var action,
|
2014-11-26 07:08:47 +00:00
|
|
|
oldScreenfull;
|
2014-11-26 06:48:12 +00:00
|
|
|
|
|
|
|
beforeEach(function () {
|
|
|
|
// Screenfull is not shimmed or injected, so
|
|
|
|
// we need to spy on it in the global scope.
|
2014-11-26 07:08:47 +00:00
|
|
|
oldScreenfull = window.screenfull;
|
2014-11-26 06:48:12 +00:00
|
|
|
|
2014-11-26 07:08:47 +00:00
|
|
|
window.screenfull = {};
|
|
|
|
window.screenfull.toggle = jasmine.createSpy("toggle");
|
2014-11-26 06:48:12 +00:00
|
|
|
|
|
|
|
action = new FullscreenAction({});
|
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(function () {
|
2014-11-26 07:08:47 +00:00
|
|
|
window.screenfull = oldScreenfull;
|
2014-11-26 06:48:12 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it("toggles fullscreen mode when performed", function () {
|
|
|
|
action.perform();
|
2014-11-26 07:08:47 +00:00
|
|
|
expect(window.screenfull.toggle).toHaveBeenCalled();
|
2014-11-26 06:48:12 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it("provides displayable metadata", function () {
|
|
|
|
expect(action.getMetadata().glyph).toBeDefined();
|
|
|
|
});
|
2014-11-26 02:30:30 +00:00
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
);
|