To Reproduce (MUST BE PROVIDED)
1) Use Query widget in any of your project.
2) Try to write Unit Tests for it.
(This widget should be used)
3) Try to mock the behavior of GraphQL Client
Expected behaviorinside calling should be printed! But it's not. This implies client.query is not being called. When went into this widget, got to know that it is using an independent method useQueryOnClient for fetching result. As this method is not wrapped under any class, it's not possible to mock it. Kindly make the methods of this widget ready for mocking. Would appreciate another method to test this widget (if exists)!
device / execution context
Are you on iOS, android, web, in a simulator, running from the terminal etc? This is especially important for localhost connection issues.
Other useful/optional fields
Please fill or delete these sections if you don't fill them in
Stacktrace:
```dart
{my stacktrace here}
```
screenshots
additional context
What backend are you trying to use?
If you have a network issue, does your operation work with GraphiQL?
additional notes
Did you struggle to understand the docs or examples, or dislike the current api?
If you want to troubleshoot or discuss in real time, consider coming to the support channel in the discord
Describe the issue This is related to the issue: https://github.com/PalisadoesFoundation/talawa/issues/1294, The file which is to be tested contains Query Widget which is not invoking the mock result.
To Reproduce (MUST BE PROVIDED) 1) Use
Query
widget in any of your project. 2) Try to write Unit Tests for it.(This widget should be used)
3) Try to mock the behavior of GraphQL Client
Expected behavior
inside calling
should be printed! But it's not. This impliesclient.query
is not being called. When went into this widget, got to know that it is using an independent methoduseQueryOnClient
for fetching result. As this method is not wrapped under any class, it's not possible to mock it. Kindly make the methods of this widget ready for mocking. Would appreciate another method to test this widget (if exists)!device / execution context Are you on iOS, android, web, in a simulator, running from the terminal etc? This is especially important for
localhost
connection issues.Other useful/optional fields
Please fill or delete these sections if you don't fill them in
Stacktrace:
```dart {my stacktrace here} ```screenshots
additional context
additional notes Did you struggle to understand the docs or examples, or dislike the current api?
If you want to troubleshoot or discuss in real time, consider coming to the
support
channel in the discord