cypress-io / cypress-realworld-testing-course-app

https://cypress-realworld-testing-course-app.vercel.app/
72 stars 225 forks source link

added an api route for email subscriptions. Wrapped the email input i… #1

Closed robertguss closed 2 years ago

robertguss commented 2 years ago

…n the home page hero in a form element to use this new api route.

linear[bot] commented 2 years ago

DX-762

vercel[bot] commented 2 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/cypress-io/cypress-realworld-testing-course-app/GSRisPRfsxB3EmzAd72zXsRZaLV2
✅ Preview: https://cypress-realworld-testing-course-app-git-dx-7-e3ab8e-cypress-io.vercel.app

robertguss commented 2 years ago

@kevinold this is a very simple API route, but I think it will do the job. Let me know what you think.

kevinold commented 2 years ago

@robertguss Looks good for the API endpoint, but use React Hook Form to manage the form and handle the result of subscribing.

robertguss commented 2 years ago

@kevinold this is ready to be reviewed again. I updated the tests to use cy.intercept to modify the content-type header as the API should only allow application/json. let me know what you think.