export default {
// solo: 1,
html: `
foo
123
1B1
`,
test({ assert, target }) {
const template = target.querySelector('#t1');
assert.htmlEqual(
template.innerHTML,
`
foo
`
);
const content = template.content.cloneNode(true);
const div = content.children[0];
assert.htmlEqual(
div.outerHTML,
`
foo
`
);
const template2 = target.querySelector('#t2');
assert.equal(template2.childNodes.length, 0);
assert.equal(template2.content.childNodes.length, 1);
assert.equal(template2.content.firstChild.textContent, '123');
assert.htmlEqual(template2.innerHTML, '123');
const template3 = target.querySelector('#t3');
assert.equal(template3.childNodes.length, 0);
assert.equal(template3.content.childNodes.length, 3);
// test: (with hydration from ssr rendered html)
// out of order render.
// 1{@html '2'}3 may render as 321 for ssr+hydration case.
// we bypass it by using symmetric siblings. hence is not fully stable for this edge case.
assert.equal(template3.content.childNodes[0].textContent, '1');
assert.equal(template3.content.childNodes[1].outerHTML, 'B');
assert.equal(template3.content.childNodes[2].textContent, '1');
}
};