mirror of
https://github.com/supabase/supabase.git
synced 2026-05-13 20:29:29 -04:00
4a0bb36ca8
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
21 lines
611 B
TypeScript
21 lines
611 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
|
|
import { getHealthLevel } from './QueryInsightsHealth.utils'
|
|
|
|
describe('getHealthLevel', () => {
|
|
it('returns healthy for scores >= 70', () => {
|
|
expect(getHealthLevel(100)).toBe('healthy')
|
|
expect(getHealthLevel(70)).toBe('healthy')
|
|
})
|
|
|
|
it('returns warning for scores between 40 and 69', () => {
|
|
expect(getHealthLevel(69)).toBe('warning')
|
|
expect(getHealthLevel(40)).toBe('warning')
|
|
})
|
|
|
|
it('returns critical for scores below 40', () => {
|
|
expect(getHealthLevel(39)).toBe('critical')
|
|
expect(getHealthLevel(0)).toBe('critical')
|
|
})
|
|
})
|