mirror of https://github.com/sveltejs/svelte
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.
41 lines
778 B
41 lines
778 B
3 years ago
|
// 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, window, 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);
|
||
|
}
|
||
|
};
|