-
-
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
If ED is being used and integration:true then I should be able to access the store #31
Comments
👍 |
I definitely agree with this. It seems a bit backwards that the store is available in a unit test, but not in an |
This seems to be possible as of 0.5 moduleForComponent('my-comp', {
integration: true,
beforeEach: function() {
this.store = this.registry.lookup('service:store');
}
} |
The point is that this shouldn't be necessary, though. It should already be there, @WooDzu |
We have service injection support now. The store is just a service, and I don't think it needs to be special-cased. The following already works in the current release: moduleForComponent('my-comp', {
integration: true,
beforeEach: function() {
this.inject.service('store');
this.get('store').createRecord(...);
}
} |
@ef4 what if the service is already injected in the component itself rather than via initializer? That doesn't seem to be working... |
I recommend against doing injection in an initializer. Declare in each component exactly which services should be injected, and tests will all work automatically. If you really need something in an initializer, you'll need to call it yourself. Initializers don't run before integration tests. |
Sorry, I misread your earlier comment. Please provide a reproduction in #109. I have lots of examples of components that do |
closing due to inactivity |
Currently if we set integration:true the store is not available, I asked @dgeb and he mentioned that we should be able to do this.
The text was updated successfully, but these errors were encountered: