This project is built with React and simulates a robot vacuum that randomly moves across the room and cleans the dirty floor.
- Button to start the cleaning process
- Button to pause the vacuuming
- Reset button (visible when paused or cleaning is finished)
- Display total steps
- Display current position
- Display time elapsed
- Dark/light mode
First, install the project dependencies: $ yarn
Then run the app:
$ yarn start
Unit and component tests are done with Jest and Testing Library (@testing-library/react)
To run the tests:
$ yarn test
The integration tests are done with Cypress. Since the robot vacuum randomly moves in either direction (including floor tiles it's already been at), we can't know when it finishes cleaning the whole floor. Because of that, we will test that the vacuuming process can start, pause and reset. Also we check for visibility of certain elements as well as testing the dark/light-mode switch.
To run the integration tests:
$ yarn cypress-ct