feat(platform-ops): 增加平台运营统计总览页面

This commit is contained in:
yml
2026-11-15 21:31:26 +08:00
parent 5ba893cfde
commit 991de90136
13 changed files with 793 additions and 24 deletions
@@ -0,0 +1,24 @@
import { describe, expect, it, vi } from 'vitest'
const apiClient = vi.hoisted(() => ({
get: vi.fn(),
}))
vi.mock('@/shared/api/client', () => ({ apiClient }))
import { fetchPlatformOverview } from './platformOps'
describe('platform ops API', () => {
it('loads the read-only platform overview', async () => {
const payload = {
generated_at: '2026-11-15T20:00:00+08:00',
totals: { tenant_count: 2 },
sites: [{ tenant_code: 'jieyou' }],
trend: [{ date: '2026-11-15' }],
}
apiClient.get.mockResolvedValueOnce({ data: { data: payload } })
await expect(fetchPlatformOverview()).resolves.toEqual(payload)
expect(apiClient.get).toHaveBeenCalledWith('/admin/platform/overview')
})
})