From 2d1f8d0a6d0fc4a303b34ffdc818f6d806791592 Mon Sep 17 00:00:00 2001 From: Miguel Camba Date: Tue, 30 Oct 2018 21:17:58 +0100 Subject: [PATCH] Add failing test for yielding inside a contextual component invoked with angle-bracket syntax that receives splattributes --- .../angle-bracket-invocation-test.js | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/packages/@ember/-internals/glimmer/tests/integration/components/angle-bracket-invocation-test.js b/packages/@ember/-internals/glimmer/tests/integration/components/angle-bracket-invocation-test.js index 366d88d2415..ddb638c6186 100644 --- a/packages/@ember/-internals/glimmer/tests/integration/components/angle-bracket-invocation-test.js +++ b/packages/@ember/-internals/glimmer/tests/integration/components/angle-bracket-invocation-test.js @@ -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: '

{{yield}}

', + }); + this.registerComponent('foo-bar', { + ComponentClass: Component.extend({ tagName: '' }), + // If doesn't receive splattributes this test passes + template: strip` + {{#let (component "foo-bar/inner") as |Inner|}} + {{yield}} +

Inside the let

+ {{/let}} +

Outside the let

+ `, + }); + + this.render('Yielded content'); + 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', + }); + } } ); }