This commit is contained in:
ryan
2026-07-13 15:08:40 +08:00
parent 08e8eea932
commit 1eff7878a1
441 changed files with 26491 additions and 18405 deletions
@@ -1,8 +1,8 @@
import {beforeEach, describe, expect, it, vi} from 'vitest';
import type {AxiosResponse} from 'axios';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import type { AxiosResponse } from 'axios';
import apiClient from '@/lib/services/core/api-client';
import {PagesService} from '@/lib/services/openflare/pages.service';
import { PagesService } from '@/lib/services/openflare/pages.service';
vi.mock('@/lib/services/core/api-client', () => ({
default: {
@@ -17,18 +17,18 @@ describe('PagesService', () => {
it('requests deployment files using the backend deployment route', async () => {
vi.mocked(apiClient.get).mockResolvedValue({
data: {error_msg: '', data: []},
data: { error_msg: '', data: [] },
status: 200,
statusText: 'OK',
headers: {},
config: {headers: {}},
config: { headers: {} },
} as AxiosResponse);
await PagesService.listDeploymentFiles(7);
expect(apiClient.get).toHaveBeenCalledWith(
'/api/v1/d/pages/deployments/7/files',
expect.objectContaining({params: undefined}),
expect.objectContaining({ params: undefined }),
);
});
});