Files
supabase/apps/studio/components/interfaces/QueryInsights/QueryInsightsHealth/QueryInsightsHealth.utils.test.ts
T
7ed8ab83a8 feat(studio): query insights improvements (#43109)
## 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>
2026-03-13 15:09:26 +00:00

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')
})
})