You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/runtime/samples/raw-mustache-inside-head/_config.js

32 lines
723 B

export default {
async test({ assert, target, window }) {
const btn = target.querySelector('button');
const clickEvent = new window.MouseEvent('click');
assert.equal(
window.document.head.innerHTML.includes(
'<style>body { color: blue; }</style><style>body { color: green; }</style>'
),
true
);
await btn.dispatchEvent(clickEvent);
assert.equal(
window.document.head.innerHTML.includes(
'<style>body { color: red; }</style><style>body { color: green; }</style>'
),
true
);
await btn.dispatchEvent(clickEvent);
assert.equal(
window.document.head.innerHTML.includes(
'<style>body { color: blue; }</style><style>body { color: green; }</style>'
),
true
);
}
};