playable
Version:
Video player based on HTML5Video
21 lines • 1.01 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var chai_1 = require("chai");
var htmlToElement_1 = (0, tslib_1.__importDefault)(require("./htmlToElement"));
describe('htmlToElement', function () {
it('should create dom element from given string with HTML', function () {
var html = '<div>TEST</div>';
var element = (0, htmlToElement_1.default)(html);
(0, chai_1.expect)(element.constructor).to.be.equal(HTMLDivElement);
});
it('should throw error if provided HTML is empty', function () {
var html = '';
(0, chai_1.expect)(function () { return (0, htmlToElement_1.default)(html); }).to.throw();
});
it("should throw error if provided HTML doesn't have root element", function () {
var html = '<span>asd</span><span>asd</span>';
(0, chai_1.expect)(function () { return (0, htmlToElement_1.default)(html); }).to.throw();
});
});
//# sourceMappingURL=htmlToElement.spec.js.map