-
-
Notifications
You must be signed in to change notification settings - Fork 155
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
Tricky to use moduleForComponent for components with sub-components #74
Comments
Yes, all my component tests are this way. Any suggestions? You have to register things on the container somewhere. Sent from my iPhone
|
I wanted to bring this up on discourse. It seems like ember-qunit should have a mode where it uses |
I'd love to hear any thoughts on this topic. Our needs for some components are getting rather long and tedious. For example, if your component uses an {{each}} you have to do: I'm not sure what the right solution here is, but it definitely feels that manually declaring ember's internal dependencies isn't it. |
i think the solution is to have a mode for these tests that are not isolated, rather pull in the entire app + non isolated container. |
@stefanpenner I assume that includes actually starting the app, or at the very least running the application initializers. We've often had to manually invoke initializers in some cases to get the test bootstrapped. I would agree though, this feels like the right approach. |
@workmanw basically the current helpers nail unit tests, but as soon as you need collaborators you are integration testing land, and these helpers leave you wanting for much more. This is a known limitation, and the hope was to continue to flesh out that aspect of these helpers but time wasn't fair to me :P |
I completely understand (and know the feeling). Thanks for the response. |
Are there any updates on this? |
If you want to test a component that uses subcomponents, you have to know to do a special needs incantation to include both the template and the component. Here's an example from Skylight:
I'm opposed exposing the container key like this anyway, but having to know how components are represented internally is definitely too much to ask new users, IMO. I'd like to see some sugar for specifying subcomponents that are required.
The text was updated successfully, but these errors were encountered: