playable
Version:
Video player based on HTML5Video
64 lines • 2.42 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
require("jsdom-global/register");
var chai_1 = require("chai");
var sinon = (0, tslib_1.__importStar)(require("sinon"));
var event_emitter_1 = (0, tslib_1.__importDefault)(require("../event-emitter/event-emitter"));
var root_container_1 = (0, tslib_1.__importDefault)(require("./root-container"));
global.requestAnimationFrame = function () { };
describe('RootContainer', function () {
var ui = {};
var eventEmitter = {};
var config = {};
beforeEach(function () {
config = {
ui: {},
};
eventEmitter = new event_emitter_1.default();
ui = new root_container_1.default({
eventEmitter: eventEmitter,
config: config,
});
});
describe('constructor', function () {
it('should create instance ', function () {
(0, chai_1.expect)(ui).to.exist;
(0, chai_1.expect)(ui.view).to.exist;
});
});
describe('API', function () {
beforeEach(function () {
ui = new root_container_1.default({
eventEmitter: eventEmitter,
config: config,
});
});
it('should have method for setting width', function () {
(0, chai_1.expect)(ui.setWidth).to.exist;
});
it('should have method for setting height', function () {
(0, chai_1.expect)(ui.setHeight).to.exist;
});
it('should have method for setting setFillAllSpace', function () {
sinon.spy(ui.view, 'setFillAllSpaceFlag');
ui.setFillAllSpace(true);
(0, chai_1.expect)(ui.view.setFillAllSpaceFlag.calledWith(true)).to.be.true;
});
it('should have method for showing whole view', function () {
(0, chai_1.expect)(ui.show).to.exist;
ui.show();
(0, chai_1.expect)(ui.isHidden).to.be.false;
});
it('should have method for hiding whole view', function () {
(0, chai_1.expect)(ui.hide).to.exist;
ui.hide();
(0, chai_1.expect)(ui.isHidden).to.be.true;
});
it('should have method for destroy', function () {
(0, chai_1.expect)(ui.destroy).to.exist;
ui.destroy();
});
});
});
//# sourceMappingURL=root-container.spec.js.map