You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/runtime/samples/transition-js-if-block-intro/_config.js

26 lines
572 B

export default {
test ( assert, component, target, window ) {
let now = 0;
let callback;
window.performance = { now: () => now };
global.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 );
now = 500;
callback();
component.destroy();
}
};