-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
58 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
test/runtime/samples/transition-css-in-out-in-with-static/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
export default { | ||
test({ assert, component, target, window, raf }) { | ||
component.visible = true; | ||
const div = target.querySelector('div'); | ||
|
||
assert.equal(div.className, '__svelte_2375698960'); | ||
assert.equal(div.style.animation, '__svelte_3809512021_0 100ms linear 0ms 1 both'); | ||
|
||
raf.tick(50); | ||
component.visible = false; | ||
|
||
// both in and out styles | ||
assert.equal(div.className, '__svelte_2375698960 __svelte_1786671888'); | ||
assert.equal(div.style.animation, '__svelte_3809512021_0 100ms linear 0ms 1 both, __svelte_3750847757_0 100ms linear 0ms 1 both'); | ||
|
||
raf.tick(75); | ||
component.visible = true; | ||
|
||
// reset original styles | ||
assert.equal(div.style.animation, '__svelte_3809512021_1 100ms linear 0ms 1 both'); | ||
assert.equal(div.className, '__svelte_2375698960'); | ||
} | ||
}; |
27 changes: 27 additions & 0 deletions
27
test/runtime/samples/transition-css-in-out-in-with-static/main.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<script> | ||
export let visible; | ||
function foo() { | ||
return { | ||
duration: 100, | ||
static_css: 'display: block', | ||
css: t => { | ||
return `opacity: ${t}`; | ||
} | ||
}; | ||
} | ||
function bar() { | ||
return { | ||
duration: 100, | ||
static_css: 'display: inline-block', | ||
css: t => { | ||
return `opacity: ${t}`; | ||
} | ||
}; | ||
} | ||
</script> | ||
|
||
{#if visible} | ||
<div in:foo out:bar></div> | ||
{/if} |