Skip to content

Commit ade0530

Browse files
committed
Failing test for concatenated classes on contextual glimmer components
1 parent 4d45b94 commit ade0530

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

packages/@ember/-internals/glimmer/tests/integration/components/angle-bracket-invocation-test.js

+19
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,25 @@ if (EMBER_GLIMMER_ANGLE_BRACKET_INVOCATION) {
783783
});
784784
}
785785

786+
'@test merges class attribute with `...attributes` in yielded contextual component ("splattributes")'() {
787+
this.registerComponent('foo-bar', {
788+
ComponentClass: Component.extend({ tagName: '' }),
789+
template: '{{yield (hash baz=(component "foo-bar/baz"))}}',
790+
});
791+
this.registerComponent('foo-bar/baz', {
792+
ComponentClass: Component.extend({ tagName: '' }),
793+
template: '<div class="default-class" ...attributes>hello</div>',
794+
});
795+
796+
this.render('<FooBar as |fb|><fb.baz class="invocation-class"></fb.baz></FooBar>');
797+
798+
this.assertElement(this.firstChild, {
799+
tagName: 'div',
800+
attrs: { class: classes('default-class invocation-class') },
801+
content: 'hello',
802+
});
803+
}
804+
786805
'@test can include `...attributes` in multiple elements in tagless component ("splattributes")'() {
787806
this.registerComponent('foo-bar', {
788807
ComponentClass: Component.extend({ tagName: '' }),

0 commit comments

Comments
 (0)