Skip to content

Commit

Permalink
Try to add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Mar 28, 2023
1 parent e7c1789 commit ca451aa
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,28 @@ module('Integration | Helper | ensure-safe-component', function (hooks) {
);
});

test('template helper with component reference', async function (assert) {
const Thing = setComponentTemplate(hbs`thing`, templateOnlyComponent());

this.inner = ensureSafeComponent(
setComponentTemplate(
hbs`
{{#let (component (ensure-safe-component this.thing)) as |Thing|}}
<Thing />
{{/let}}
`,
class extends Component {
thing = Thing;
}
),
this
);
await render(hbs`
<this.inner @name={{component "some-component"}} />
`);
assert.strictEqual(this.element.textContent.trim(), 'thing');
});

test('template helper with string value', async function (assert) {
this.set('name', 'some-component');
await assert.expectDeprecation(async () => {
Expand Down

0 comments on commit ca451aa

Please sign in to comment.