Failing test for #1999

pull/2028/head
pk 6 years ago
parent b015c001cc
commit 2491b16341

@ -0,0 +1,26 @@
export default {
props: {
titles: [{ name: 'b' }, { name: 'c' }],
tree: [
{id: 1, sub: null},
{id: 2, sub: [{id: 11}]}
]
},
html: `
<div>1</div>
<div>2\n<div>11</div></div>
`,
test({ assert, component, target }) {
component.tree = [
{id: 1, sub: null},
{id: 2, sub: null}
];
assert.htmlEqual(target.innerHTML, `
<div>1</div>
<div>2</div>
`);
}
};

@ -0,0 +1,12 @@
<script>
export let tree;
</script>
{#each tree as item, i (item.id)}
<div>
{item.id}
{#if item.sub}
<svelte:self tree={item.sub}/>
{/if}
</div>
{/each}
Loading…
Cancel
Save