Skip to content

Commit

Permalink
Avoid assertion when bound id is provided to tagless component
Browse files Browse the repository at this point in the history
  • Loading branch information
HeroicEric authored and webark committed Oct 6, 2016
1 parent e446fb2 commit 502a081
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 502a081

Please sign in to comment.