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

Use our facility fake data to implement a mock graphQL request with a test querying the facilities #832

Open
3 tasks
NabbeunNabi opened this issue Oct 21, 2024 · 0 comments
Assignees
Labels
pair programming This is a ticket that is good to pair with someone on testing vitest Tests related to functional testing with Vitest.

Comments

@NabbeunNabi
Copy link
Contributor

Problem

Currently, we have one fake data file in our test folder that isn't being used (mockFacilityData.json). We need to be able to mock our graphQL request and use our fake data as a successful response from the server.

Success

The best way to mock and import fake data with graphQL is implemented and test are written querying the facilities using our existing facility fake data. This facility fake data can be updated if it isn't the same as our current database schema. To figure out what the data looks at you can look at the schema or run the backend firebase emulator and see how the data of a facility is structured.

Requirements

  • Research how to mock a graphQL endpoint with Nuxt, graphQL, and vitest
  • Implement mocking of the endpoint within a file located at test/functional/facilitiesStore.spec.ts with the existing fake data in test/mockData/facilityMockData.json
  • Comments are present in the code so people can follow how to mock and test functionality in the future with graphQL
@NabbeunNabi NabbeunNabi added the pair programming This is a ticket that is good to pair with someone on label Oct 23, 2024
@gminetoma gminetoma added the vitest Tests related to functional testing with Vitest. label Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pair programming This is a ticket that is good to pair with someone on testing vitest Tests related to functional testing with Vitest.
Projects
None yet
Development

No branches or pull requests

5 participants