Skip to content
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 Mock the Result of Query Widget #1408

Open
Manik2708 opened this issue Feb 16, 2024 · 0 comments
Open

Not able to Mock the Result of Query Widget #1408

Manik2708 opened this issue Feb 16, 2024 · 0 comments

Comments

@Manik2708
Copy link

Manik2708 commented Feb 16, 2024

Describe the issue
This is related to the issue: PalisadoesFoundation/talawa#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.

Screenshot from 2024-02-16 23-28-44
(This widget should be used)

  1. Try to mock the behavior of GraphQL Client

Screenshot from 2024-02-16 23-38-46

Expected behavior
inside 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:
{my stacktrace here}

screenshots
Screenshot from 2024-02-16 23-28-20

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant