Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make unit test file MaternalHealthProvider.test.ts #3305

Closed
4 tasks done
benhammondmusic opened this issue May 15, 2024 · 0 comments · Fixed by #3387
Closed
4 tasks done

Make unit test file MaternalHealthProvider.test.ts #3305

benhammondmusic opened this issue May 15, 2024 · 0 comments · Fixed by #3387

Comments

@benhammondmusic
Copy link
Collaborator

benhammondmusic commented May 15, 2024

Creating Test Cases for the New Data Provider

  • In the same directory, create a new file for your dataset's provider tests, named similarly to your provider with a test prefix, e.g., [YourDatasetName]Provider.test.ts.
  • Create test functions that cover different scenarios your data provider might encounter. This includes different demographic breakdowns, geographic levels (national, state, county), and any other significant variations in data requests. For each test:
    • Define the dataset IDs and breakdowns you'll test against.
    • Use mock data and responses to simulate the fetching process.
    • Assert that the data provider returns the expected results.
  • Implement a utility function similar to ensureCorrectDatasetsDownloaded to verify that your data provider correctly identifies and fetches the necessary datasets based on the breakdowns and demographic types provided in the query.
  • For each test, document the specific scenario, such as "Testing data fetch for state-level race breakdown."
kccrtv pushed a commit to kccrtv/health-equity-tracker that referenced this issue Jun 28, 2024
…tcherInstitute#3387)

# Description and Motivation
- creates test cases for Maternal Mortality Data Provider

closes SatcherInstitute#3305 

## Has this been tested? How?

- tests pass locally

## Screenshots (if appropriate)

<img width="441" alt="Screenshot 2024-06-19 at 2 37 12 PM"
src="https://gist.github.com/assets/28677929/5b8da1c5-ab18-4c8c-8163-b34598c0d437">

## Types of changes

(leave all that apply)

- New content or feature

## New frontend preview link is below in the Netlify comment 😎
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant