Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom each behavior (track-array) should survive an undefined item in the array #20793

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,23 @@
this.assertHTML('<ul><li>2</li><li>4</li><li>6</li></ul>');
this.assertStableRerender();
}

['@test survives undefined item with key'](assert) {

Check failure on line 42 in packages/ember-template-compiler/tests/plugins/assert-array-test.js

View workflow job for this annotation

GitHub Actions / Linting

'assert' is defined but never used
// 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();
}
}
);
Loading