QueryInsightsHealth.utils.test.ts20 lines · main
| 1 | import { describe, expect, it } from 'vitest' |
| 2 | |
| 3 | import { getHealthLevel } from './QueryInsightsHealth.utils' |
| 4 | |
| 5 | describe('getHealthLevel', () => { |
| 6 | it('returns healthy for scores >= 70', () => { |
| 7 | expect(getHealthLevel(100)).toBe('healthy') |
| 8 | expect(getHealthLevel(70)).toBe('healthy') |
| 9 | }) |
| 10 | |
| 11 | it('returns warning for scores between 40 and 69', () => { |
| 12 | expect(getHealthLevel(69)).toBe('warning') |
| 13 | expect(getHealthLevel(40)).toBe('warning') |
| 14 | }) |
| 15 | |
| 16 | it('returns critical for scores below 40', () => { |
| 17 | expect(getHealthLevel(39)).toBe('critical') |
| 18 | expect(getHealthLevel(0)).toBe('critical') |
| 19 | }) |
| 20 | }) |