From 2491b163413e554689f5f1357152e9d9a06068ac Mon Sep 17 00:00:00 2001 From: pk Date: Wed, 30 Jan 2019 18:27:11 +0100 Subject: [PATCH] Failing test for #1999 --- .../each-block-keyed-recursive/_config.js | 26 +++++++++++++++++++ .../each-block-keyed-recursive/main.html | 12 +++++++++ 2 files changed, 38 insertions(+) create mode 100644 test/runtime/samples/each-block-keyed-recursive/_config.js create mode 100644 test/runtime/samples/each-block-keyed-recursive/main.html diff --git a/test/runtime/samples/each-block-keyed-recursive/_config.js b/test/runtime/samples/each-block-keyed-recursive/_config.js new file mode 100644 index 0000000000..e124f14ccf --- /dev/null +++ b/test/runtime/samples/each-block-keyed-recursive/_config.js @@ -0,0 +1,26 @@ +export default { + props: { + titles: [{ name: 'b' }, { name: 'c' }], + tree: [ + {id: 1, sub: null}, + {id: 2, sub: [{id: 11}]} + ] + }, + + html: ` +
1
+
2\n
11
+ `, + + test({ assert, component, target }) { + component.tree = [ + {id: 1, sub: null}, + {id: 2, sub: null} + ]; + + assert.htmlEqual(target.innerHTML, ` +
1
+
2
+ `); + } +}; diff --git a/test/runtime/samples/each-block-keyed-recursive/main.html b/test/runtime/samples/each-block-keyed-recursive/main.html new file mode 100644 index 0000000000..5e90ec501c --- /dev/null +++ b/test/runtime/samples/each-block-keyed-recursive/main.html @@ -0,0 +1,12 @@ + + +{#each tree as item, i (item.id)} +
+ {item.id} + {#if item.sub} + + {/if} +
+{/each}