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-slot-4-cancelled/_config.js

36 lines
716 B

// updated props in the middle of transitions
// and cancelled the transition halfway
export default {
html: `
<div>outside Foo Foo Foo</div>
<div>inside Foo Foo Foo</div>
`,
props: {
props: 'Foo'
},
async test({ assert, component, target, raf }) {
await component.hide();
const [, div] = target.querySelectorAll('div');
raf.tick(50);
assert.equal(div.foo, 0.5);
component.props = 'Bar';
assert.htmlEqual(target.innerHTML, `
<div>outside Bar Bar Bar</div>
<div>inside Foo Foo Foo</div>
`);
await component.show();
assert.htmlEqual(target.innerHTML, `
<div>outside Bar Bar Bar</div>
<div>inside Bar Bar Bar</div>
`);
raf.tick(100);
assert.equal(div.foo, 1);
}
};