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/head-if-else-raw-dynamic/_config.js

20 lines
564 B

const foo = '<script type="application/json">{ "foo": "true" }</script>';
const bar = '<script type="application/json">{ "bar": "true" }</script>';
export default {
props: {
condition: false,
foo,
bar
},
test({ assert, component, window }) {
assert.equal(window.document.head.innerHTML.includes(foo), false);
assert.equal(window.document.head.innerHTML.includes(bar), true);
component.condition = true;
assert.equal(window.document.head.innerHTML.includes(foo), true);
assert.equal(window.document.head.innerHTML.includes(bar), false);
}
};