Skip to content

Commit

Permalink
Failing test for concatenated classes on contextual glimmer components
Browse files Browse the repository at this point in the history
  • Loading branch information
cibernox committed Sep 1, 2018
1 parent 4d45b94 commit ade0530
Showing 1 changed file with 19 additions and 0 deletions.
Expand Up @@ -783,6 +783,25 @@ if (EMBER_GLIMMER_ANGLE_BRACKET_INVOCATION) {
});
}

'@test merges class attribute with `...attributes` in yielded contextual component ("splattributes")'() {
this.registerComponent('foo-bar', {
ComponentClass: Component.extend({ tagName: '' }),
template: '{{yield (hash baz=(component "foo-bar/baz"))}}',
});
this.registerComponent('foo-bar/baz', {
ComponentClass: Component.extend({ tagName: '' }),
template: '<div class="default-class" ...attributes>hello</div>',
});

this.render('<FooBar as |fb|><fb.baz class="invocation-class"></fb.baz></FooBar>');

this.assertElement(this.firstChild, {
tagName: 'div',
attrs: { class: classes('default-class invocation-class') },
content: 'hello',
});
}

'@test can include `...attributes` in multiple elements in tagless component ("splattributes")'() {
this.registerComponent('foo-bar', {
ComponentClass: Component.extend({ tagName: '' }),
Expand Down

0 comments on commit ade0530

Please sign in to comment.