forked from sveltejs/svelte
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Yury Zhuravlev
committed
Jul 6, 2018
1 parent
a043c44
commit 7cab338
Showing
4 changed files
with
44 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
22 changes: 22 additions & 0 deletions
22
test/runtime/samples/transition-js-if-block-outro-timeout/_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,22 @@ | ||
export default { | ||
test ( assert, component, target, window, raf ) { | ||
component.set({ visible: true }); | ||
const div = target.querySelector('div'); | ||
|
||
component.set({ visible: false }); | ||
assert.equal(window.getComputedStyle(div).opacity, 1); | ||
|
||
raf.tick(200); | ||
assert.equal(window.getComputedStyle(div).opacity, 0.5); | ||
component.set({ blabla: false }); | ||
|
||
raf.tick(400); | ||
assert.equal(window.getComputedStyle(div).opacity, 0); | ||
|
||
raf.tick(600); | ||
assert.equal(component.refs.div, undefined); | ||
assert.equal(target.querySelector('div'), undefined); | ||
|
||
component.destroy(); | ||
} | ||
}; |
18 changes: 18 additions & 0 deletions
18
test/runtime/samples/transition-js-if-block-outro-timeout/main.html
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,18 @@ | ||
{#if visible} | ||
<div out:fade style="opacity: 1;" ref:div>yes</div> | ||
{/if} | ||
|
||
<script> | ||
export default { | ||
transitions: { | ||
fade: function ( node, params ) { | ||
return { | ||
duration: 400, | ||
tick: t => { | ||
node.style.opacity = t; | ||
} | ||
}; | ||
} | ||
} | ||
}; | ||
</script> |