feat(platform-ops): 增加平台运营统计总览页面
This commit is contained in:
@@ -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')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user