ember-polyfills / ember-angle-bracket-invocation-polyfill

MIT License
76 stars 33 forks source link

Testing component with angle brackets fails in addon #21

Open myu20 opened 6 years ago

myu20 commented 6 years ago

Hi, I have an addon with a component that invokes another component with angle brackets, e.g.

// link-inner.hbs
<a href={{link}}>{{text}}</a>
// link-outer.hbs
<LinkInner @link="/" @text="Link text" />

If I test the outer component, the test fails with the error

not ok 9 Chrome 67.0 - Global error: Uncaught Error: Assertion Failed: You cannot use 'LinkInner' as a component name. Component names must contain a hyphen

However, if I generate the same components in an app, the outer component test passes. Is this the intended behavior? I have a repo with an example app and addon here.

Thanks!

jacojoubert commented 6 years ago

I ran into the same issue. Angle bracket components don't currently work anywhere in the addon folder. I created a brand new addon to verify this. Angle bracket components do work in the addon's dummy app though.

I tried looking at how the AST works, but I couldn't figure it out why it wouldn't be working.

rwjblue commented 6 years ago

@myu20 - https://github.com/rwjblue/ember-angle-bracket-invocation-polyfill/pull/19 should have fixed this. I believe the issue is that you don't have a new enough ember-cli-htmlbars-inline-precompile version.

Can you double check?

rwjblue commented 6 years ago

@jacojoubert - That sounds like a different issue than reported, can you open another issue and provide a demo repo that I can look through?

myu20 commented 6 years ago

@rwjblue I'm using ^1.0.3 of ember-cli-htmlbars-inline-precompile

jackiehluo commented 5 years ago

+1, i'm running into this issue, too! in my integration tests:

Assertion Failed: You cannot use \'CvrToggleButton\' as a component name. Component names must contain a hyphen.