Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx committed Oct 18, 2024
1 parent 3a4b73c commit 0025c4a
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1219,6 +1219,20 @@ class DynamicStrictModeTest extends RenderTest {
}, /Expected a dynamic component definition, but received an object or function that did not have a component manager associated with it. The dynamic invocation was `<this.Foo>` or `\{\{this.Foo\}\}`, and the incorrect definition is the value at the path `this.Foo`, which was:/u);
}

@test
'Throws an error with correct debug label if a non-component is used as a component'() {
const Foo = defineSimpleHelper(() => 'Hello, world!');
const Bar = defineComponent({}, '{{#let this.Foo as |foo|}}<foo/>{{/let}}', {
definition: class extends GlimmerishComponent {
Foo = Foo;
},
});

this.assert.throws(() => {
this.renderComponent(Bar);
}, /Expected a dynamic component definition, but received an object or function that did not have a component manager associated with it. The dynamic invocation was `<foo>` or `\{\{foo\}\}`, and the incorrect definition is the value at the path `foo`, which was:/u);
}

@test
'Can pass helper as argument and invoke dynamically'() {
const plusOne = defineSimpleHelper(() => 'Hello, world!');
Expand Down

0 comments on commit 0025c4a

Please sign in to comment.