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

Unit tests for the DataGridScores component will sometimes not reach 100% coverage. #2133

Open
FrenjaminBanklin opened this issue May 1, 2024 · 0 comments
Labels
beginner friendly bug Something isn't working chore Maintain a clean and strong character. testing

Comments

@FrenjaminBanklin
Copy link
Contributor

See this line in the tests and this line in the component, for example.

I think the intention of this code is to make sure that mockStartDate is always one day back from the current date, but this code will produce a number rather than a date. If this happens to run on the first day of the month, the result is that mockStartDate is 0 which will not produce test cases that reach all of the component's code.

Replace new Date().getDate() - 1 with code that will actually find the previous day's date.

@FrenjaminBanklin FrenjaminBanklin added bug Something isn't working testing beginner friendly chore Maintain a clean and strong character. labels May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginner friendly bug Something isn't working chore Maintain a clean and strong character. testing
Projects
None yet
Development

No branches or pull requests

1 participant