Skip to content

Commit 10ec911

Browse files
author
pushkin
authored
test unrelated update does not cancel if_block outro
1 parent c7328ff commit 10ec911

File tree

6 files changed

+68
-0
lines changed

6 files changed

+68
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<script>
2+
export let condition;
3+
function foo(node, params) {
4+
return {
5+
duration: 100,
6+
tick: t => {
7+
node.foo = t;
8+
}
9+
};
10+
}
11+
let bool = true;
12+
</script>
13+
14+
<button on:click={() => (condition = false)} id="1" />
15+
<button on:click={() => (bool = !bool)} />
16+
{#if bool}
17+
<div out:foo />
18+
{/if}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default {
2+
test({ assert, target, window, raf }) {
3+
target.querySelector("button").click();
4+
raf.tick(500);
5+
assert.htmlEqual(target.innerHTML, "");
6+
},
7+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<script>
2+
import Component from "./Component.svelte";
3+
let condition = true;
4+
</script>
5+
6+
{#if condition}
7+
<Component bind:condition />
8+
{/if}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<script>
2+
export let condition;
3+
function foo(node, params) {
4+
return {
5+
duration: 100,
6+
tick: t => {
7+
node.foo = t;
8+
}
9+
};
10+
}
11+
$condition;
12+
let bool = true;
13+
</script>
14+
15+
<button on:click={() => (bool = !bool)} />
16+
{#if bool}
17+
<div out:foo />
18+
{/if}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default {
2+
test({ assert, target, window, raf }) {
3+
target.querySelector("button").click();
4+
raf.tick(500);
5+
assert.htmlEqual(target.innerHTML, "");
6+
},
7+
};
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<script>
2+
import { writable } from "svelte/store";
3+
import Component from "./Component.svelte";
4+
let condition = writable(true);
5+
</script>
6+
7+
{#if $condition}
8+
<button on:click={() => ($condition = false)} id="1" />
9+
<Component {condition} />
10+
{/if}

0 commit comments

Comments
 (0)