Skip to content

Commit

Permalink
Additional coverage for each iteration with undefined item and specif…
Browse files Browse the repository at this point in the history
…ied key
  • Loading branch information
NullVoxPopuli committed Nov 13, 2024
1 parent 6b8c02f commit b85779c
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { defineComponent, jitSuite, RenderTest, test, tracked } from '../..';

class Each extends RenderTest {
static suiteName = '{{#each}} keyword';

@test
'each with undefined item https://github.com/emberjs/ember.js/issues/20786'() {
class State {
@tracked data = [undefined];
}

let state = new State();

const Bar = defineComponent(
{ state },
`{{#each state.data key='anything' as |datum|}}
{{datum}}
{{/each}}`
.replaceAll(/^\s|\s+$|\s+(?=\s)/gu, '')
.replaceAll(/\n/gu, '')
);

this.renderComponent(Bar);

this.assertHTML(' ');
}
}

jitSuite(Each);

0 comments on commit b85779c

Please sign in to comment.