diff --git a/test/runtime/samples/each-block-keyed-containing-self-in-if-with-else-branch/Nested.svelte b/test/runtime/samples/each-block-keyed-containing-self-in-if-with-else-branch/Nested.svelte new file mode 100644 index 0000000000..a9831fc1a9 --- /dev/null +++ b/test/runtime/samples/each-block-keyed-containing-self-in-if-with-else-branch/Nested.svelte @@ -0,0 +1,5 @@ + + +{item.id} diff --git a/test/runtime/samples/each-block-keyed-containing-self-in-if-with-else-branch/_config.js b/test/runtime/samples/each-block-keyed-containing-self-in-if-with-else-branch/_config.js new file mode 100644 index 0000000000..0aebab391c --- /dev/null +++ b/test/runtime/samples/each-block-keyed-containing-self-in-if-with-else-branch/_config.js @@ -0,0 +1,48 @@ +export default { + props: { + list: [ + { id: 1 }, + { id: 2 }, + { id: 3, children: [{ id: 30 }, { id: 31 }, { id: 32 }] }, + ], + activeId: null, + }, + + html: ` + + `, + + test({ assert, component, target }) { + component.activeId = 3; + + assert.htmlEqual(target.innerHTML, ` + + `); + + + component.activeId = null; + + assert.htmlEqual(target.innerHTML, ` + + `); + } +}; diff --git a/test/runtime/samples/each-block-keyed-containing-self-in-if-with-else-branch/main.svelte b/test/runtime/samples/each-block-keyed-containing-self-in-if-with-else-branch/main.svelte new file mode 100644 index 0000000000..5d5c4ba35d --- /dev/null +++ b/test/runtime/samples/each-block-keyed-containing-self-in-if-with-else-branch/main.svelte @@ -0,0 +1,19 @@ + + +