Skip to content

Commit

Permalink
[BUGFIX beta] Adding tests for #18732
Browse files Browse the repository at this point in the history
(cherry picked from commit 004cea1)
  • Loading branch information
GCheung55 authored and kategengler committed Feb 25, 2020
1 parent 25d7d2c commit 9ff6fe2
Showing 1 changed file with 63 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,69 @@ moduleFor(

this.assertStableRerender();
}

['@test GH#18732 hasBlock works within a yielded curried component invoked within mustaches'](assert) {
this.registerComponent('component-with-has-block', {
ComponentClass: Component.extend(),
template: '<div>{{hasBlock}}</div>'
});

this.registerComponent('yielding-component', {
ComponentClass: Component.extend(),
template: '{{yield (component "component-with-has-block")}}'
});

this.registerComponent('test-component', {
ComponentClass: Component.extend(),
template: '{{#yielding-component as |componentWithHasBlock|}}{{componentWithHasBlock}}{{/yielding-component}}'
});

this.render('{{test-component}}');

this.assertText('false');
}

['@test GH#18732 has-block works within a yielded curried component invoked with angle bracket invocation (falsy)']() {
this.registerComponent('component-with-has-block', {
ComponentClass: Component.extend(),
template: '<div>{{hasBlock}}</div>'
});

this.registerComponent('yielding-component', {
ComponentClass: Component.extend(),
template: '{{yield (component "component-with-has-block")}}'
});

this.registerComponent('test-component', {
ComponentClass: Component.extend(),
template: '{{#yielding-component as |componentWithHasBlock|}}<componentWithHasBlock/>{{/yielding-component}}'
});

this.render('{{test-component}}');

this.assertText('false');
}

['@test GH#18732 has-block works within a yielded curried component invoked with angle bracket invocation (truthy)']() {
this.registerComponent('component-with-has-block', {
ComponentClass: Component.extend(),
template: '<div>{{hasBlock}}</div>'
});

this.registerComponent('yielding-component', {
ComponentClass: Component.extend(),
template: '{{yield (component "component-with-has-block")}}'
});

this.registerComponent('test-component', {
ComponentClass: Component.extend(),
template: '{{#yielding-component as |componentWithHasBlock|}}<componentWithHasBlock></componentWithHasBlock>{{/yielding-component}}'
});

this.render('{{test-component}}');

this.assertText('true');
}
}
);

Expand Down

0 comments on commit 9ff6fe2

Please sign in to comment.