From 8f592ed317de47519daf33bbbd6a42910f7e36f0 Mon Sep 17 00:00:00 2001 From: Eric Kelly Date: Wed, 28 Sep 2016 21:32:57 -0700 Subject: [PATCH] Avoid assertion when bound `id` is provided to tagless component See https://github.com/emberjs/ember.js/pull/14382 --- .../components/fragment-components-test.js | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/packages/ember-glimmer/tests/integration/components/fragment-components-test.js b/packages/ember-glimmer/tests/integration/components/fragment-components-test.js index 85c8eaff0c8..c00e652a9a8 100644 --- a/packages/ember-glimmer/tests/integration/components/fragment-components-test.js +++ b/packages/ember-glimmer/tests/integration/components/fragment-components-test.js @@ -165,6 +165,29 @@ moduleFor('Components test: fragment components', class extends RenderingTest { this.assertText('baz'); } + ['@test does not throw an error if `tagName` is an empty string and `id` is bound property specified via template']() { + let template = `{{id}}`; + let FooBarComponent = Component.extend({ + tagName: '' + }); + + this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template }); + + this.render(`{{#foo-bar id=fooBarId}}{{/foo-bar}}`, { fooBarId: 'baz' }); + + this.assertText('baz'); + + this.assertStableRerender(); + + this.runTask(() => set(this.context, 'fooBarId', 'qux')); + + this.assertText('qux'); + + this.runTask(() => set(this.context, 'fooBarId', 'baz')); + + this.assertText('baz'); + } + ['@test does not throw an error if `tagName` is an empty string and `id` is specified via template and passed to child component']() { let fooBarTemplate = `{{#baz-child id=id}}{{/baz-child}}`; let FooBarComponent = Component.extend({