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/dynamic-element-variable/_config.js

23 lines
364 B

export default {
get props() {
return { tag: 'div', text: 'Foo' };
},
html: '<div>Foo</div>',
test({ assert, component, target }) {
const div = target.firstChild;
component.tag = 'nav';
component.text = 'Bar';
assert.htmlEqual(
target.innerHTML,
`
<nav>Bar</nav>
`
);
const h1 = target.firstChild;
assert.notEqual(div, h1);
}
};