From fb5ab8241b446ab3580446bd4132d369b8a2268b Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Tue, 16 Jul 2024 09:18:00 -0400 Subject: [PATCH] fix test --- .../_config.js | 10 ++++++---- .../main.svelte | 18 +++++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/packages/svelte/tests/runtime-legacy/samples/transition-css-in-out-in-with-param/_config.js b/packages/svelte/tests/runtime-legacy/samples/transition-css-in-out-in-with-param/_config.js index a53c559f0f..47a97415c7 100644 --- a/packages/svelte/tests/runtime-legacy/samples/transition-css-in-out-in-with-param/_config.js +++ b/packages/svelte/tests/runtime-legacy/samples/transition-css-in-out-in-with-param/_config.js @@ -1,22 +1,24 @@ import { ok, test } from '../../test'; export default test({ - skip: true, test({ assert, component, target, raf }) { component.visible = true; const div = target.querySelector('div'); ok(div); - assert.equal(div.style.opacity, '0'); + assert.equal(div.style.color, 'blue'); component.visible = false; - assert.equal(div.style.opacity, '1'); + assert.equal(div.style.color, 'yellow'); // change param raf.tick(1); component.param = 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'); } }); diff --git a/packages/svelte/tests/runtime-legacy/samples/transition-css-in-out-in-with-param/main.svelte b/packages/svelte/tests/runtime-legacy/samples/transition-css-in-out-in-with-param/main.svelte index 616e2e0e8b..34f8b7083d 100644 --- a/packages/svelte/tests/runtime-legacy/samples/transition-css-in-out-in-with-param/main.svelte +++ b/packages/svelte/tests/runtime-legacy/samples/transition-css-in-out-in-with-param/main.svelte @@ -3,19 +3,19 @@ export let param = false; function getInParam() { - return { - duration: param ? 20 : 10, - css: t => { - return `opacity: ${t}`; + return { + duration: 100, + css: (t) => { + return `color: ${param ? 'red' : 'blue'}`; } }; } function getOutParam() { - return { - duration: param ? 15 : 5, - css: t => { - return `opacity: ${t}`; + return { + duration: 100, + css: (t) => { + return `color: ${param ? 'green' : 'yellow'}`; } }; } @@ -23,4 +23,4 @@ {#if visible}
-{/if} \ No newline at end of file +{/if}