playable
Version:
Video player based on HTML5Video
46 lines • 1.63 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var chai_1 = require("chai");
var text_map_1 = (0, tslib_1.__importDefault)(require("./text-map"));
var testkit_1 = (0, tslib_1.__importDefault)(require("../../testkit"));
describe('TextMap module', function () {
var testkit;
beforeEach(function () {
testkit = (0, testkit_1.default)();
testkit.registerModule('textMap', text_map_1.default);
});
it('should have ability to get text from it', function () {
testkit.setConfig({
texts: {
testID: 'testText',
},
});
var map = testkit.getModule('textMap');
(0, chai_1.expect)(map.get).to.exist;
(0, chai_1.expect)(map.get('testID')).to.be.equal('testText');
});
it('should pass arguments to translate function', function () {
testkit.setConfig({
texts: {
testID: function (_a) {
var arg = _a.arg;
return "Test:".concat(arg);
},
},
});
var map = testkit.getModule('textMap');
(0, chai_1.expect)(map.get('testID', { arg: 1 })).to.be.equal('Test:1');
});
it('should return undefined if destroyed', function () {
testkit.setConfig({
texts: {
testID: 'testText',
},
});
var map = testkit.getModule('textMap');
map.destroy();
(0, chai_1.expect)(map.get('testID')).to.be.equal(undefined);
});
});
//# sourceMappingURL=text-map.spec.js.map