failing test for intro transition

pull/525/head
Rich-Harris 8 years ago
parent 2784ae0ade
commit 4fa776561d

@ -0,0 +1,23 @@
export default {
test ( assert, component, target, window ) {
let now = 0;
let callback;
window.performance = { now: () => now };
window.requestAnimationFrame = cb => callback = cb;
component.set({ visible: true });
const div = target.querySelector( 'div' );
assert.equal( window.getComputedStyle( div ).opacity, 0 );
now = 200;
callback();
assert.equal( window.getComputedStyle( div ).opacity, 0.5 );
now = 400;
callback();
assert.equal( window.getComputedStyle( div ).opacity, 1 );
component.destroy();
}
};

@ -0,0 +1,3 @@
{{#if visible}}
<div in:style='{opacity: 0}'>fades in</div>
{{/if}}
Loading…
Cancel
Save