-
-
Notifications
You must be signed in to change notification settings - Fork 257
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
Unit testing components with new attrs hash #63
Comments
I am experiencing this too. Any luck? |
Life is better using component integration tests, but I still think this is an issue |
Yeah, I need to switch our tests to integration tests... |
I definitely think this is worth addressing. Integration tests and unit tests are different things, and unit tests not actually simulating the running conditions of components is problematic. Unit tests are great for white-box testing components -- trigger an action or set a property, and make sure that a computed property updated properly, or that another action was triggered or something. For the same reason that you don't always want to test your application by interacting only with the DOM (i.e. acceptance tests), you don't always want to test your components by interacting only with the DOM (i.e. integration tests). In both cases you sometimes was unit tests. So why not just write unit tests as integration tests? Well, you can't without some serious hackery because integration tests don't give you access to the component object ( |
I believe that this should work properly now with the new ember-qunit APIs. Happy to reopen if I am mistaken... |
Upgrade path to using the new
attrs
hash is difficult...this.render
:The component lifecycle hooks don't get called as you would expect.
this.render
:You still need to be able to get the component's attributes, but you can't, because
didInitAttrs
hasn't been called.(A potential workaround is to manually call
didInitAttrs
but this only works if you actually have a function calleddidInitAttrs
)Apologies if this is the wrong repo.
The text was updated successfully, but these errors were encountered: