Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing component with angle brackets fails in addon #21

Open
myu20 opened this issue Jul 5, 2018 · 5 comments
Open

Testing component with angle brackets fails in addon #21

myu20 opened this issue Jul 5, 2018 · 5 comments

Comments

@myu20
Copy link

myu20 commented Jul 5, 2018

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
Copy link
Contributor

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
Copy link
Member

rwjblue commented Jul 9, 2018

@myu20 - #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
Copy link
Member

rwjblue commented Jul 9, 2018

@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
Copy link
Author

myu20 commented Jul 9, 2018

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

@jackiehluo
Copy link

+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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants