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.
24 lines
406 B
24 lines
406 B
3 years ago
|
export default {
|
||
|
html: `
|
||
|
<div>Foo</div>
|
||
|
`,
|
||
|
|
||
|
async test({ assert, component, target, window, raf }) {
|
||
|
await component.hide();
|
||
|
const div = target.querySelector('div');
|
||
|
|
||
|
raf.tick(50);
|
||
|
assert.equal(div.foo, 0.5);
|
||
|
|
||
|
await component.show();
|
||
|
|
||
|
assert.htmlEqual(target.innerHTML, '<div>Bar</div>');
|
||
|
|
||
|
raf.tick(75);
|
||
|
assert.equal(div.foo, 0.75);
|
||
|
|
||
|
raf.tick(100);
|
||
|
assert.equal(div.foo, 1);
|
||
|
}
|
||
|
};
|