Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
pushkine committed Apr 21, 2020
1 parent 0bcfc1b commit 08b3abb
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 1 deletion.
1 change: 0 additions & 1 deletion test/js/samples/test

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<script>
export let action;
</script>

<div use:action />
21 changes: 21 additions & 0 deletions test/runtime/samples/each-block-keyed-component-action/_config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export default {
test({ assert, component, raf }) {
assert.equal(component.count, 0);

component.arr = ["2"];

assert.equal(component.count, 1);

component.arr = ["1", "2"];

assert.equal(component.count, 2);

component.arr = ["2", "1"];

assert.equal(component.count, 2);

component.arr = [];

assert.equal(component.count, 0);
},
};
17 changes: 17 additions & 0 deletions test/runtime/samples/each-block-keyed-component-action/main.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<script>
import Component from "./Component.svelte";
export let arr = [];
export let count = 0;
function action(node, params) {
count += 1;
return {
destroy() {
count -= 1;
}
};
}
</script>

{#each arr as item (item)}
<Component {action} />
{/each}

0 comments on commit 08b3abb

Please sign in to comment.