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 (#1658)
  • Loading branch information
NullVoxPopuli authored Nov 13, 2024
1 parent 228d484 commit c8c1d91
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 c8c1d91

Please sign in to comment.