mirror of
https://github.com/sveltejs/svelte.git
synced 2024-12-01 17:30:59 +01:00
f45e2b70fd
This also includes elements of RFCs 2 and 3
25 lines
426 B
JavaScript
25 lines
426 B
JavaScript
export default {
|
|
props: {
|
|
x: false
|
|
},
|
|
|
|
test({ assert, component, target, window, raf }) {
|
|
component.x = true;
|
|
|
|
const div = target.querySelector('div');
|
|
assert.equal(div.foo, 0);
|
|
|
|
raf.tick(100);
|
|
assert.equal(div.foo, 1);
|
|
|
|
component.x = false;
|
|
assert.htmlEqual(target.innerHTML, '<div></div>');
|
|
|
|
raf.tick(150);
|
|
assert.equal(div.foo, 0.5);
|
|
|
|
raf.tick(200);
|
|
assert.htmlEqual(target.innerHTML, '');
|
|
}
|
|
};
|