-
-
Notifications
You must be signed in to change notification settings - Fork 312
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
Not able to flush multiple times to test subscriptions #1563
Comments
In addition, I want to propose to add this possibility to Queries too. |
I fully agree, yes, would love to see this. Our use case is mocking a GraphQL query that has the pollInterval option set. Without being able to flush twice and complete (I'll skip the obvious potty joke here ;) it is hard to test that our software operates properly when the operation is polled again and either changes or stays the same. |
Hm, strange that this has not been implemented yet. It seems to be such a core thing |
same problem here. we are using a subscription on valueChanges to update our template accordingly if something was added or removed in the data. |
Is there any workaround for this other than completely mocking the GraphQL Service?
The complete statement may be prevented on a My Shoot at this issue: #2316 feel free to test, comment and review. |
I'm not able to test a component which uses a subscription to receive updates because it's not possible to call
flush(...)
multiple times on a TestOperation. The contained observer is completed after calling flush for the first time.Here's an example of a failing test showing this behavior.
An additional argument
keepOpen: bool
(with defaultfalse
) or an additional function likeflushAndKeepOpen(...)
, omitting the call to complete(), could solve this.The text was updated successfully, but these errors were encountered: