@@ -51,7 +51,9 @@ describe('HelloState component', () => {
5151 // mounted component can be selected via its name, function, or JSX
5252 // e.g. '@HelloState', HelloState, or <HelloState />
5353 cy .get (HelloState).invoke (' setState' , { name: ' React' })
54- cy .get (HelloState).its (' state' ).should (' deep.equal' , { name: ' React' })
54+ cy .get (HelloState)
55+ .its (' state' )
56+ .should (' deep.equal' , { name: ' React' })
5557 // check if GUI has rerendered
5658 cy .contains (' Hello React!' )
5759 })
@@ -98,7 +100,7 @@ import './styles.css'
98100You can read the CSS file and pass it as ` style ` option yourself
99101
100102``` js
101- cy .readFile (' cypress/integration/Button.css' ).then (( style ) => {
103+ cy .readFile (' cypress/integration/Button.css' ).then (style => {
102104 cy .mount (< Button name= " Orange" orange / > , { style })
103105})
104106```
@@ -172,7 +174,7 @@ If you already have a plugins file, you can use a file preprocessor that points
172174``` js
173175// your project's Cypress plugin file
174176const craFilePreprocessor = require (' cypress-react-unit-test/plugins/cra-v3/file-preprocessor' )
175- module .exports = ( on ) => {
177+ module .exports = on => {
176178 on (' file:preprocessor' , craFilePreprocessor ())
177179}
178180```
@@ -197,6 +199,9 @@ All components are in [src](src) folder. All tests are in [cypress/integration](
197199- [ bahmutov/calculator] ( https://github.com/bahmutov/calculator ) tests multiple components: calculator App, Button, Display.
198200- [ bahmutov/react-todo-with-hooks] ( https://github.com/bahmutov/react-todo-with-hooks ) branch ` added-tests `
199201- [ bahmutov/test-redux-examples] ( https://github.com/bahmutov/test-redux-examples ) branch ` mount2 `
202+ - [ bahmutov/test-react-hooks-animations] ( https://github.com/bahmutov/test-react-hooks-animations ) react hooks with spring animations test
203+
204+ To find more examples, see GitHub topic [ cypress-react-unit-test-example] ( https://github.com/topics/cypress-react-unit-test-example )
200205
201206## Development
202207
0 commit comments