Three functions were written for our bottom 10s lists, but tests were not added at the time. This PR catches up.
Add tests for findBottomDrinkers
Add tests for findBottomSleepers
Add tests for findBottomStepTakers
Add data to /src/data/testData.js so the tests have to calculate for more than 10 users and sort out the bottom 10
Note that this required a couple of other test tweaks because the added data changed some values in the tests (generateRandomUserID and findStepGoalAverage specifically).
Contributors
@ericahagle
Notes
I think some stuff might appear to be changes, but are actually just caused by where I put the tests. Some line reconciliation, but not actual changes to the rest of the tests. The only actual changes are called out in the PR description.
I couldn't think of a good way to add sad paths for these. I know that If there are fewer than 10, it'll just return all the available records, because I tested it when there were only the three users in our test data. But I don't know that it's worth it to jump through hoops to recreate that now that I bumped up the test data.
Checklist
[x] My PR has an appropriately descriptive and concise title.
[x] My PR denotes any/all team members who contributed to it.
[x] My code follows the Turing Style Guides and best practices.
[x] I ran the code locally and verified that there are no visible errors.
[x] test: My PR clearly describes what tests I'm adding and any why.
Description
Three functions were written for our bottom 10s lists, but tests were not added at the time. This PR catches up.
findBottomDrinkers
findBottomSleepers
findBottomStepTakers
/src/data/testData.js
so the tests have to calculate for more than 10 users and sort out the bottom 10generateRandomUserID
andfindStepGoalAverage
specifically).Contributors
@ericahagle
Notes
Checklist