mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 09:55:06 +03:00
* Fix tests in tests/unit, tests/components and files under tests, looking into tests/pages * Fix tests under pages/projects root * Fix * Comment out broken tests that im stuck with * Fix api-report.test * Fix storage-report-test * chore: fix some tests * chore: remove logging * Fix LogsPreviewer.test.js * Fix most of logs-query-test * Skip broken tests instead of false positiving them * Replace jest with vitest * Rename all *.test.js to *.test.ts * Configure vitest to work with jsx * fix vitest issues, fix tests, skip broken tests, add msw, add next-router-mock * uncomment file * add tests for msw and nrm * Fix failing tests * fix tests in RowEditor * fix datepicker tests * fix type errors and comment out tests that need some refactoring * leave 1 test so test script works * rm clog and aaaaa * rename script * move msw to studio * add pckg json which i forgot in last commit * rm consolelog * move vitest ui dep * Move next-router-mock to studio. --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com> Co-authored-by: TzeYiing <ty@tzeyiing.com> Co-authored-by: Kamil Ogórek <kamil.ogorek@gmail.com> Co-authored-by: Terry Sutton <saltcod@gmail.com> Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
30 lines
876 B
TypeScript
30 lines
876 B
TypeScript
import { vi } from 'vitest'
|
|
|
|
export const useApiReport = vi.fn().mockReturnValue({
|
|
data: {
|
|
totalRequests: [{ count: 4, timestamp: '2024-05-09T04:00:00.000Z' }],
|
|
topRoutes: [
|
|
{ count: 1, method: 'HEAD', path: '/rest/v1/', search: null, status_code: 200 },
|
|
{ count: 2, method: 'GET', path: '/rest/v1/', search: null, status_code: 200 },
|
|
{ count: 3, method: 'GET', path: '/auth/v1/health', search: null, status_code: 200 },
|
|
],
|
|
topErrorRoutes: [
|
|
{ count: 1, method: 'GET', path: '/auth/v1/user', search: null, status_code: 403 },
|
|
],
|
|
},
|
|
params: {
|
|
totalRequests: {
|
|
iso_timestamp_start: '2024-05-09T03:00:00.000Z',
|
|
project: 'default',
|
|
sql: '',
|
|
},
|
|
},
|
|
filters: [],
|
|
isLoading: false,
|
|
mergeParams: vi.fn(),
|
|
addFilter: vi.fn(),
|
|
removeFilter: vi.fn(),
|
|
removeFilters: vi.fn(),
|
|
refresh: vi.fn(),
|
|
})
|