ourjapanlife / findadoc-web

Front-end repository for Find a Doc, Japan
https://findadoc.jp
BSD 3-Clause "New" or "Revised" License
15 stars 13 forks source link

FEAT: Enable Cypress tests to run using fake data #538

Open ermish opened 1 month ago

ermish commented 1 month ago

Problem

Our cypress tests are running against the api and every test is pulling fresh data which can accrue costs and eat our bandwith limits for our API + Databases. To solve this, we can have cypress run against fake data and not call the API. Cypress has a guide to this

To ensure we can still connect to the API successfully, we should be able to toggle between the real API or fake data.

Success

We can run against fake data or connect to the API with a simple toggle

Requirements

NabbeunNabi commented 1 month ago

@ermish is this separate to the quick fix to keep it from posting submissions. Or do you want this all to be the same PR?

ermish commented 1 month ago

Likely separate, but the quick fix could reference this as this is a bit broader. I think it depends on if you're doing a quick hack for the submissions or if you're trying to do a proper cypress mock