Something went wrong on our end
Select Git revision
Monster.Data.html
-
Volker Schukai authoredVolker Schukai authored
customelement-initfromscripthost.mjs 4.77 KiB
'use strict';
import * as chai from 'chai';
import {getDocument} from "../../../source/dom/util.mjs";
import {chaiDom} from "../../util/chai-dom.mjs";
import {initJSDOM} from "../../util/jsdom.mjs";
let expect = chai.expect;
chai.use(chaiDom);
// let html1 = `
// <div id="scripthost">
// </div>
//
// <div>
// <
// </div>
// `;
// defined in constants.mjs
// const updaterSymbolKey = "@schukai/monster/dom/custom-element@@options-updater-link"
// const updaterSymbolSymbol = Symbol.for(updaterSymbolKey);
describe('DOM', function () {
let CustomElement, registerCustomElement, TestComponent, document, TestComponent2,assignUpdaterToElement;
describe('initFromScriptHost()', function () {
const randomTagNumber = "monster-test"+Math.floor(Math.random() * 1000000);
before(function (done) {
initJSDOM().then(() => {
import("../../../source/dom/customelement.mjs").then((m) => {
try {
CustomElement = m['CustomElement'];
registerCustomElement = m['registerCustomElement'];
TestComponent2 = class extends CustomElement {
static getTag() {
return randomTagNumber;
}
/**
*
* @return {Object}
*/
get defaults() {
return Object.assign({}, super.defaults, {
test: 0,
templates: {
main: '<h1></h1><article><p>test</p><div id="container"></div></article>'
},
})
}
}
registerCustomElement(TestComponent2)
document = getDocument();
done()
} catch (e) {