fix(editor): Handle Insights calculations to prevent Infinity numbers (#15727)

This commit is contained in:
Raúl Gómez Morales
2025-05-27 14:30:18 +02:00
committed by GitHub
parent 3c0e13dd6a
commit d1a39d96bb
2 changed files with 14 additions and 7 deletions

View File

@@ -81,8 +81,8 @@ describe('Insights Transformers', () => {
});
it('should return Infinity if value equals deviation (and thus previous value is 0)', () => {
expect(transformInsightsDeviation.total(10, 10)).toBe(Infinity);
expect(transformInsightsDeviation.failed(5, 5)).toBe(Infinity);
expect(transformInsightsDeviation.total(10, 10)).toBe(null);
expect(transformInsightsDeviation.failed(5, 5)).toBe(null);
});
it('should return 0 if deviation is 0 and value is not 0', () => {