Obojobo icon indicating copy to clipboard operation
Obojobo copied to clipboard

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

Open FrenjaminBanklin opened this issue 9 months ago • 0 comments

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 avatar May 01 '24 20:05 FrenjaminBanklin