File tree 1 file changed +19
-0
lines changed
packages/@ember/-internals/glimmer/tests/integration/components
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -783,6 +783,25 @@ if (EMBER_GLIMMER_ANGLE_BRACKET_INVOCATION) {
783
783
} ) ;
784
784
}
785
785
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
+
786
805
'@test can include `...attributes` in multiple elements in tagless component ("splattributes")' ( ) {
787
806
this . registerComponent ( 'foo-bar' , {
788
807
ComponentClass : Component . extend ( { tagName : '' } ) ,
You can’t perform that action at this time.
0 commit comments