CDCgov / prime-simplereport

SimpleReport is a fast, free, and easy way for COVID-19 testing facilities to report results to public health departments.
https://simplereport.gov
Creative Commons Zero v1.0 Universal
56 stars 55 forks source link

[SPIKE] - Investigate MSW implementation to more parts of the frontend testing setup #6402

Open fzhao99 opened 1 year ago

fzhao99 commented 1 year ago

MSW is an API mocking library similar to Wiremock but for Javascript. We're using it in our Storybook setup and the team suspects there might be productivity improvements to spreading this more generally into our frontend testing setup. Understanding much of our frontend testing PR's contain setting up GraphQL mocks, there might be an opportunity to centralize / decouple the data mocking away from our functional UI code much like we have with Wiremock on the backend.

This spike captures the work necessary to research and put together a proof of concept for using MSW endpoints for our GraphQL mocking setup to determine if we should proceed with adopting MSW. Some adoption guidelines and larger considerations for future work are also appropriate.

Useful links

Link to their example GQL setup in their docs

The Storybook addon that we're using in our frontend component setup

fzhao99 commented 3 months ago

Updated to a new MSW version here