/test-material-ui

Testing Material UI components using Cypress

Primary LanguageJavaScript

test-material-ui

Testing Material UI components using Cypress

cypress version cypress-react-unit-test version

Uses cypress-react-unit-test

Installation

$ npx create-react-app test-material-ui
$ cd test-material-ui

$ yarn add @material-ui/core @material-ui/icons @material-ui/lab
info Direct dependencies
├─ @material-ui/core@4.9.9
├─ @material-ui/icons@4.9.1
└─ @material-ui/lab@4.0.0-alpha.48

$ yarn add -D cypress-react-unit-test@3.0.0-cypress-mount-mode.14

Add cypress.json with experimental flag

Write components and specs in src folder. I recommend looking at src/autocomplete-spec.js

Autocomplete test

And src/date-picker-spec.js

Date and time picker