From a847d895378ff4ca4081432f4e3f221b7b8201bf Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Wed, 13 Nov 2024 18:57:59 -0500 Subject: [PATCH] Create repro for https://github.com/emberjs/ember.js/issues/20786 --- .../tests/plugins/assert-array-test.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/ember-template-compiler/tests/plugins/assert-array-test.js b/packages/ember-template-compiler/tests/plugins/assert-array-test.js index 0e6b13a5cd1..16ad9f56045 100644 --- a/packages/ember-template-compiler/tests/plugins/assert-array-test.js +++ b/packages/ember-template-compiler/tests/plugins/assert-array-test.js @@ -38,5 +38,23 @@ moduleFor( this.assertHTML(''); 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 }, + `` + ); + this.registerComponent('root', { ComponentClass: Root }); + + this.render(''); + this.assertHTML(''); + this.assertStableRerender(); + } } );