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/transition-js-dynamic-compo.../_config.js

41 lines
510 B

export default {
get props() {
return { x: true };
},
html: `
<div>a</div>
`,
test({ assert, component, target, raf }) {
component.x = false;
assert.htmlEqual(
target.innerHTML,
`
<div>a</div>
<div>b</div>
`
);
const [a, b] = target.querySelectorAll('div');
raf.tick(25);
assert.equal(a.a, 0.75);
assert.equal(b.b, 0.25);
raf.tick(100);
assert.equal(a.a, 0);
assert.equal(b.b, 1);
assert.htmlEqual(
target.innerHTML,
`
<div>b</div>
`
);
}
};