mirror of
https://github.com/supabase/supabase.git
synced 2026-10-08 02:45:07 +03:00
## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? This introduces Query Insights. It's the first edition of possible future updates. This takes our old prototype and builds upon it for a more action driven insights view. --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Ali Waseem <waseema393@gmail.com>
20 lines
610 B
TypeScript
20 lines
610 B
TypeScript
import { describe, it, expect } 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')
|
|
})
|
|
})
|