Skip to content

Commit

Permalink
Create repro for emberjs#20786
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Nov 13, 2024
1 parent 1a63242 commit a847d89
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,23 @@ moduleFor(
this.assertHTML('<ul><li>2</li><li>4</li><li>6</li></ul>');
this.assertStableRerender();
}

['@test survives undefined item with key'](assert) {
// Intentionally double all of the values to verify that this
// version of the `array` function is used.
function array(...values) {
return values.map((value) => value * 2);
}

let Root = defineComponent(
{ array },
`<ul>{{#each (array undefined) key="anything" as |item|}}<li>{{item}}</li>{{/each}}</ul>`
);
this.registerComponent('root', { ComponentClass: Root });

this.render('<Root />');
this.assertHTML('<ul><li></li></ul>');
this.assertStableRerender();
}
}
);

0 comments on commit a847d89

Please sign in to comment.