Files
supabase/apps/studio/lib/http-status-codes.test.ts
Jordi Enric 3b3a75202e feat: add auth reports FE-1569 (#36555)
* feat: add auth reports

* fix reports dates, fix missing queries

* add flag

* fix errorbystatus chart

* fix sign in by grant type

* move formatting to auth report query file

* fix signup by provider, add ratelimitted reqs

* fix sign ups query

* cleanup unused stuff

* cleanup

* rm console logs

* undo logs.utils

* add status code lib, use edge_logs for query

* fix auth error chart footer

* rm redundant rate limited requests chart

* fix db report breaking due to useAuthReport throwing

* move state up, reduce conditional logic in composed chart handler

* reorder reports nav

* rm bg

* fix type err

* fix useChartData

* empty

* fix report header bg

* move to utils

* add AnalyticsInterval import to report.utils for granularity conversion
2025-06-27 11:10:25 +02:00

25 lines
758 B
TypeScript

import { describe, expect, it } from 'vitest'
import { getHttpStatusCodeInfo } from './http-status-codes'
describe('getHttpStatusCodeInfo', () => {
it('should return the correct status code info', () => {
const statusCodeInfo = getHttpStatusCodeInfo(400)
expect(statusCodeInfo).toEqual({
code: 400,
name: 'BAD_REQUEST',
message: 'The server cannot or will not process the request due to an apparent client error.',
label: 'Bad Request',
})
})
it('should return unknown for an unknown status code', () => {
const statusCodeInfo = getHttpStatusCodeInfo(999)
expect(statusCodeInfo).toEqual({
code: 999,
name: 'UNKNOWN',
message: 'Unknown status code',
label: 'Unknown',
})
})
})