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-reuse-children/_config.js

23 lines
389 B

export default {
props: {
tag: 'div',
text: 'Foo'
},
html: '<div><div>Foo</div></div>',
test({ assert, component, target }) {
const innerDiv = target.querySelector('div > div');
component.tag = 'h1';
component.text = 'Bar';
assert.htmlEqual(
target.innerHTML,
`
<h1><div>Bar</div></h1>
`
);
assert.equal(innerDiv, target.querySelector('h1 > div'));
}
};