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-5-cancel.../_config.js

41 lines
770 B

// updated props in the middle of transitions
// and cancelled the transition halfway
// + spreaded props + overflow context
export default {
html: `
<div>outside Foo Foo Foo</div>
<div>inside Foo Foo Foo</div>
0
`,
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>
0
`);
await component.show();
assert.htmlEqual(target.innerHTML, `
<div>outside Bar Bar Bar</div>
<div>inside Bar Bar Bar</div>
0
`);
raf.tick(100);
assert.equal(div.foo, 1);
}
};