These examples taken from redux site and tested using cypress-react-unit-test
- counter from codesandbox
- shopping-cart from codesandbox
- async actions from codesandbox
See cypress-react-unit-test and cypress.json
Shopping cart App component test
Reddit async reader App component test
- clone this repo
- install dependencies with
npm install
- open Cypress:
npm run open
ornpx cypress open
If you want to try writing Cypress unit tests against the React code, good candidates for rewriting are:
- src/shopping-cart/components/Product.spec.js
- src/shopping-cart/components/ProductItem.spec.js
- easy unit tests in src/shopping-cart/reducers
- continue the entire app test in src/shopping-cart/containers/App.cy-spec.js
- continue testing async Reddit reader in src/async/containers and its individual components