Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raphaeljcm/order-phases-testing-final-exam
Final Exam from the course Testing React with Jest and React Testing Library (RTL)
https://github.com/raphaeljcm/order-phases-testing-final-exam
jest msw reactjs testing-library
Last synced: 16 days ago
JSON representation
Final Exam from the course Testing React with Jest and React Testing Library (RTL)
- Host: GitHub
- URL: https://github.com/raphaeljcm/order-phases-testing-final-exam
- Owner: raphaeljcm
- Created: 2022-07-08T00:40:40.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-09T01:00:56.000Z (over 2 years ago)
- Last Synced: 2023-03-10T10:05:19.754Z (almost 2 years ago)
- Topics: jest, msw, reactjs, testing-library
- Language: JavaScript
- Homepage:
- Size: 652 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sundaes on Demand
This project accompanies the Udemy course [Testing React with Jest and Testing Library](https://www.udemy.com/course/react-testing-library/).
## Final Exam Code Quiz Spec
### What to Test
* "Happy path" (aka "Happy Day" or "Golden Path") test
* Tests that execute customer flow without error
* For our app:
* Create order
* Accept terms and submit
* Click “new order” on confirmation page
* Don’t need to test different combinations of orders
* Covered in order page testing### New Mock Service Worker Handler
* New Handler
* mimic POST for order confirmation with Mock Service Worker
* implementation: call POST via useEffect in OrderConfirmation
* make up format of the data sent to server, or send no data
* server simply generates random order number and sends it back as JSON
* Warning about using copy/paste to create new handler
* I do this all the time
* If you do, be sure to change the method from get to post
* If you neglect to do this, it's very difficult to track down!
* Will get error like Error: connect ECONNREFUSED 127.0.0.1Good luck!