failing test for intro transition

pull/7738/head
Rich-Harris 9 years ago
parent 41700f689b
commit 61e7089f9e

@ -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