Skip to content

Robot vacuum that cleans a 10x10 grid of floor tiles.

Notifications You must be signed in to change notification settings

NordlingDev/robovacuum

Repository files navigation

RoboVacuum

This project is built with React and simulates a robot vacuum that randomly moves across the room and cleans the dirty floor.

Screenshot

Features

  • 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

Usage

First, install the project dependencies: $ yarn

Then run the app:

$ yarn start

Tests

Unit Tests

Unit and component tests are done with Jest and Testing Library (@testing-library/react)

To run the tests:

$ yarn test

Integration Tests

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