freeCodeCamp/classroom

Add test to ensure data loads on teacher dashboard

Opened this issue · 1 comments

Currently, no tests exist to ensure that a teacher's dashboard will load with data/how to handle a lack of data.

These tests should take into consideration these scenarios:

  • Data is fetched correctly and displayed on the dashboard
  • Data cannot be fetched and the dashboard renders an error instead

You can use our already existing mock server (Step 8 in the 'Get the code' section of the readme) to simulate data fetching. Please note that this server must be running locally alongside the app to be able to access the data inside of it.

We can make use of Jest asynchronous testing.

The data that currently lives inside the mock server is not the exact format the dashboard requires.

Because of this, we can mock the entire dashboard rather than just the component that the dashboard uses to ensure that our data is properly set up for the test. Or take on issue # before this one, and have that code run before these tests.

CodeDay Labs Students will be working on this