0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00
svelte/test/runtime/samples/transition-js-nested-component/_config.js
Rich Harris f45e2b70fd
Implement reactive assignments (#1839)
This also includes elements of RFCs 2 and 3
2018-12-15 19:18:03 -05:00

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, '');
}
};