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-intr.../_config.js

46 lines
973 B

export default {
test ( assert, component, target, window, raf ) {
component.set({ visible: true });
let div = target.querySelector( 'div' );
assert.equal( div.foo, 0 );
raf.tick( 200 );
assert.equal( div.foo, 0.5 );
raf.tick( 400 );
assert.equal( div.foo, 1 );
raf.tick( 500 );
assert.equal( div.foo, 1 );
component.set({ visible: false });
raf.tick( 600 );
assert.equal( div.foo, 1 );
assert.equal( div.bar, 0.75 );
raf.tick( 900 );
assert.equal( div.foo, 1 );
assert.equal( div.bar, 0 );
// test outro before intro complete
raf.tick( 1000 );
component.set({ visible: true });
div = target.querySelector( 'div' );
raf.tick( 1200 );
assert.equal( div.foo, 0.5 );
component.set({ visible: false });
raf.tick( 1300 );
assert.equal( div.foo, 0.75 );
assert.equal( div.bar, 0.75 );
raf.tick( 1400 );
assert.equal( div.foo, 1 );
assert.equal( div.bar, 0.5 );
raf.tick( 2000 );
component.destroy();
}
};