-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Additional coverage for each iteration with undefined item and specif…
…ied key (#1658)
- Loading branch information
1 parent
228d484
commit c8c1d91
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
packages/@glimmer-workspace/integration-tests/test/keywords/each-test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |