useApiReport.ts29 lines · main
| 1 | import { vi } from 'vitest' |
| 2 | |
| 3 | export const useApiReport = vi.fn().mockReturnValue({ |
| 4 | data: { |
| 5 | totalRequests: [{ count: 4, timestamp: '2024-05-09T04:00:00.000Z' }], |
| 6 | topRoutes: [ |
| 7 | { count: 1, method: 'HEAD', path: '/rest/v1/', search: null, status_code: 200 }, |
| 8 | { count: 2, method: 'GET', path: '/rest/v1/', search: null, status_code: 200 }, |
| 9 | { count: 3, method: 'GET', path: '/auth/v1/health', search: null, status_code: 200 }, |
| 10 | ], |
| 11 | topErrorRoutes: [ |
| 12 | { count: 1, method: 'GET', path: '/auth/v1/user', search: null, status_code: 403 }, |
| 13 | ], |
| 14 | }, |
| 15 | params: { |
| 16 | totalRequests: { |
| 17 | iso_timestamp_start: '2024-05-09T03:00:00.000Z', |
| 18 | project: 'default', |
| 19 | sql: '', |
| 20 | }, |
| 21 | }, |
| 22 | filters: [], |
| 23 | isLoading: false, |
| 24 | mergeParams: vi.fn(), |
| 25 | addFilter: vi.fn(), |
| 26 | removeFilter: vi.fn(), |
| 27 | removeFilters: vi.fn(), |
| 28 | refresh: vi.fn(), |
| 29 | }) |