feature: 增加功能 导出详细报告
This commit is contained in:
@@ -17,6 +17,14 @@ describe('ApiClient', () => {
|
||||
).rejects.toMatchObject({ kind: 'validation' })
|
||||
})
|
||||
|
||||
it('returns file responses without parsing them as JSON', async () => {
|
||||
const blob = new Blob(['# report'], { type: 'text/markdown' })
|
||||
const fetchMock = vi.spyOn(globalThis, 'fetch').mockResolvedValue(new Response(blob))
|
||||
|
||||
await expect(new ApiClient('/api', () => 'token').request('/runs/1/export', { responseType: 'blob' })).resolves.toEqual(expect.any(Blob))
|
||||
expect(new Headers(fetchMock.mock.calls[0][1]?.headers).get('Accept')).toBe('text/markdown')
|
||||
})
|
||||
|
||||
it('refreshes and replays a business request once after 401', async () => {
|
||||
let token = 'old-token'
|
||||
const refresh = vi.fn(async (force?: boolean) => {
|
||||
|
||||
Reference in New Issue
Block a user