ucfopen / Obojobo

Next generation course content for your LMS. Easy for beginners, but powerful enough for researchers.
https://ucfopen.github.io/Obojobo-Docs/
GNU Affero General Public License v3.0
70 stars 34 forks source link

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

Open FrenjaminBanklin opened 7 months ago

FrenjaminBanklin commented 7 months ago

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.