-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
Integration tests breaks for components that inject notifications #169
Comments
@Edralo This issue may not relate to this project but an issue with qunit: ember-cli/ember-cli#6945. Did you have this issue after migrating ember-cli? |
My last comment may not be helpful to you, I was able to resolve this issue partially by correctly requiring the notification-messages by its' correct resolver name in my unit tests like so:
Note that the services actual name in the container is: |
I think I was on the right track. I'm not sure how we are able to inject
Updating your needs to my above code snippet will then generate the following error:
You can correct this error, as a quick fix, by registering 'service:notification-messages-service' as
However I was able to remove all these errors by renaming |
Fresh [email protected] app example documenting issue: https://github.com/Matt-Jensen/ember-cli-notifications-test. Pull and run tests to reproduce above errors. |
Thanks for the unit tests ! Unfortunately, I'm still stuck about the integrations tests. Maybe I should investigate about ember-qunit and ember-cli-qunit (since we're using the latter) |
I was able to clear up the integration test issues with the same approach:
|
Sorry for the late comment, we finally fixed it. We still had injections issue with your solution but it was easily fixable. We also needed to import the service via its installed directory inside the project and used it directly inside
Thanks a lot for the help @Matt-Jensen |
Oops, sure |
I'll merge #171 and roll it in to the |
While this will work, its only a half measure and breaking convention over configuration. You will note on the documentation page you still have to import notification-messages-service to extend which is not what would be expected. The service really should be renamed everywhere for a complete fix. In the meantime in the consuming application just creating a new service under whatever name you wish (notification-messages in this case), importing and only extending notification-messages-service will work as well without this pull request. |
@cah-briangantzler I'll be renaming the service hence the breaking change and a required major release with |
This has changed with the release of #251 and shouldn't be an issue anymore 👍 let me know if you have any questions or are still having problems |
Hello !
After upgrading a project from ember 2.11 to 2.13, I noticed that all the integration tests of the components that injects ember-cli-notifications are breaking :
Assertion Failed: Attempting to inject an unknown injection: 'service:notification-messages'
.In these components, I inject your addon "individually" via :
notifications: Ember.inject.service('notification-messages'),
.I also tried to inject via an initializer afterward, and tests are ok with that method. The problem is I don't need to inject it everywhere, so I shouldn't use an initializer in my project..
I made a small repo that replicate this problem : https://github.com/Edralo/notification-test-fail
I haven't looked much to find where the problem is, but maybe it's linked to https://github.com/emberjs/rfcs/blob/master/text/0150-factory-for.md since the problem appeared with ember 2.12.
That's pretty much all i know about the issue for now, sorry
The text was updated successfully, but these errors were encountered: