add test for transitions on nested components

pull/1210/head
ekhaled 8 years ago
parent 2e3724f7d3
commit 7401004a66

@ -0,0 +1,21 @@
export default {
test ( assert, component, target, window, raf ) {
component.set({ visible: true });
const div = target.querySelector( 'div' );
assert.equal( div.foo, 0 );
raf.tick( 50 );
assert.equal( div.foo, 0 );
raf.tick( 100 );
assert.equal( div.foo, 0.5 );
raf.tick( 125 );
assert.equal( div.foo, 0.75 );
raf.tick( 150 );
assert.equal( div.foo, 1 );
component.destroy();
}
};

@ -0,0 +1,17 @@
<div transition:foo><slot></slot></div>
<script>
export default {
transitions: {
foo: function ( node, params ) {
return {
delay: 50,
duration: 100,
tick: t => {
node.foo = t;
}
};
}
}
};
</script>

@ -0,0 +1,10 @@
{{#if visible}}
<Child>delayed</Child>
{{/if}}
<script>
import Child from './Child.html';
export default {
components:{ Child }
};
</script>
Loading…
Cancel
Save