Skip to content

Commit

Permalink
[BUGFIX beta] Add failing test for yielding inside a contextual compo…
Browse files Browse the repository at this point in the history
…nent invoked with angle-bracket syntax that receives splattributes

(cherry picked from commit 2d1f8d0)
  • Loading branch information
cibernox authored and rwjblue committed Jan 22, 2019
1 parent 7600d7b commit 7eca43f
Showing 1 changed file with 35 additions and 0 deletions.
Expand Up @@ -919,6 +919,41 @@ if (EMBER_GLIMMER_ANGLE_BRACKET_INVOCATION) {
content: 'world',
});
}

'@test can yield content to contextual components invoked with angle-bracket components that receives splattributes'() {
this.registerComponent('foo-bar/inner', {
ComponentClass: Component.extend({ tagName: '' }),
template: '<h1 ...attributes>{{yield}}</h1>',
});
this.registerComponent('foo-bar', {
ComponentClass: Component.extend({ tagName: '' }),
// If <Inner> doesn't receive splattributes this test passes
template: strip`
{{#let (component "foo-bar/inner") as |Inner|}}
<Inner ...attributes>{{yield}}</Inner>
<h2>Inside the let</h2>
{{/let}}
<h3>Outside the let</h3>
`,
});

this.render('<FooBar>Yielded content</FooBar>');
this.assertElement(this.firstChild, {
tagName: 'h1',
attrs: {},
content: 'Yielded content',
});
this.assertElement(this.nthChild(1), {
tagName: 'h2',
attrs: {},
content: 'Inside the let',
});
this.assertElement(this.nthChild(2), {
tagName: 'h3',
attrs: {},
content: 'Outside the let',
});
}
}
);
}

0 comments on commit 7eca43f

Please sign in to comment.