mirror of
https://github.com/supabase/supabase.git
synced 2026-05-22 17:00:43 +08:00
* 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
25 lines
758 B
TypeScript
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',
|
|
})
|
|
})
|
|
})
|