fix: filter out disabled checks for execution count total#999
Conversation
| }, | ||
| ]); | ||
|
|
||
| expect(result.current.data).toBe(EXECUTIONS); |
There was a problem hiding this comment.
Are we certain EXECUTIONS contains the correct value here? Shouldn't we use a mocked value instead to validate it is returning the results we want in a more explicit way?
There was a problem hiding this comment.
I thought about hard-coding it but the problem is if we ever do update the calculation in getChecksPerMonth (which is likely as it doesn't match how backend calculate it) this test breaks for no real reason.
The focus of this test is checking whether the execution count matches what we would expect for the amount of enabled tests rather than checking if the precise execution count is correct. You helpfully added those tests so that's why I'm not concerned with this test doubling up and checking them, too 😃
Addresses the FE portion of: https://github.com/grafana/support-escalations/issues/13498
Problem
We aren't filtering out disabled checks when calculating a user's execution count.
Solution
Add a filter to remove disabled checks when checking monthly execution counts.