freeCodeCamp / freeCodeCamp/classroom

Add test to ensure data loads on teacher dashboard

Open
#327 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
155
Forks
138
PR merge metrics
No merged PRs in 30d

Description

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'](https://github.com/freeCodeCamp/classroom#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](https://jestjs.io/docs/asynchronous).

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.