-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
Error when testing a component that contains infinity-loader #229
Comments
@finferflu so in this case, you will want to
|
@snewcomer Thanks a lot for the feedback. I'm not sure what I'm doing wrong, but I'm getting exactly the same error. My integration test is roughly as follows:
(The user is set by using Mirage, in case that matters at all). |
Sry that is my bad. So one thing about developing prod code is also making it testable. One way to modify your code is to use closure actions instead of send action. Then you are just overriding the infinityLoad action. You can also try |
Thanks for the feedback. I did try with a closure function, and my test passed, however, my component no longer works now. It is not clear to me how the closure action is to be used. I've tried including it in my component invocation, as follows:
However, that produces an error:
The fact is that I'm not sure how In my component, I have this:
And in my component, I have this (notice the lack of quotes around the word
|
@finferflu the infinityLoad action lives on the route, not the controller. So this pkg might helpful if you are still having problems. https://github.com/DockYard/ember-route-action-helper |
@snewcomer Well, to simplify things, I've ended up un-nesting Ember Infinity, so that it sits next to my component, rather than inside it. I have a lot of repeated code now, but at least it works! |
Great! Closing for now. Reach out if you have any other questions. |
OK, will do, thank you! |
I am using
ember-infinity
in a nested component, exactly as described here, and it works just fine, however, when testing the component, I get the following error:This is the full error stack:
I'm pretty sure this has to do with integration tests not running inside an Ember server instance, but I'm really not well versed into the infrastructure of Ember, so I'm wondering what might be done to get that fixed.
Thanks a lot for your time!
The text was updated successfully, but these errors were encountered: