pull/12453/head
Rich Harris 2 years ago
parent bcc05f202d
commit fb5ab8241b

@ -1,22 +1,24 @@
import { ok, test } from '../../test'; import { ok, test } from '../../test';
export default test({ export default test({
skip: true,
test({ assert, component, target, raf }) { test({ assert, component, target, raf }) {
component.visible = true; component.visible = true;
const div = target.querySelector('div'); const div = target.querySelector('div');
ok(div); ok(div);
assert.equal(div.style.opacity, '0'); assert.equal(div.style.color, 'blue');
component.visible = false; component.visible = false;
assert.equal(div.style.opacity, '1'); assert.equal(div.style.color, 'yellow');
// change param // change param
raf.tick(1); raf.tick(1);
component.param = true; component.param = true;
component.visible = true; component.visible = true;
assert.equal(div.style.opacity, '1'); assert.equal(div.style.color, 'red');
component.visible = false;
assert.equal(div.style.color, 'green');
} }
}); });

@ -3,19 +3,19 @@
export let param = false; export let param = false;
function getInParam() { function getInParam() {
return { return {
duration: param ? 20 : 10, duration: 100,
css: t => { css: (t) => {
return `opacity: ${t}`; return `color: ${param ? 'red' : 'blue'}`;
} }
}; };
} }
function getOutParam() { function getOutParam() {
return { return {
duration: param ? 15 : 5, duration: 100,
css: t => { css: (t) => {
return `opacity: ${t}`; return `color: ${param ? 'green' : 'yellow'}`;
} }
}; };
} }
@ -23,4 +23,4 @@
{#if visible} {#if visible}
<div in:getInParam out:getOutParam></div> <div in:getInParam out:getOutParam></div>
{/if} {/if}

Loading…
Cancel
Save