The following scenarios will be covered:
- Test an interaction with a DOM element that updates state. [
Counter
] - Test a component wrapped in a HOC (e.g. Redux' mapState). [
ScreenWidth
,PageURL
] - Create snapshots for the above. [
All component tests
]
- Test a component that is wrapped in the React context. [
PageURL
] - Test a React ref attached to a DOM node. [
Reminder
] - Test code that uses browser global variables. [
ScreenWidth
]
The components and tests are in ./src/components
.
The tests for Component.jsx
are in Component.test.jsx
.
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Runs the tests in watch mode.
Runs the tests in watch mode and shows the test coverage.