|
|
@@ -0,0 +1,37 @@
|
|
|
+import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
|
+
|
|
|
+const getMock = vi.fn();
|
|
|
+const postMock = vi.fn();
|
|
|
+
|
|
|
+vi.mock('/@/utils/axios-utils', () => ({
|
|
|
+ axiosInstance: {
|
|
|
+ get: (...args: unknown[]) => getMock(...args),
|
|
|
+ post: (...args: unknown[]) => postMock(...args),
|
|
|
+ },
|
|
|
+ serveConfig: {
|
|
|
+ basePath: '/prod-api',
|
|
|
+ },
|
|
|
+}));
|
|
|
+
|
|
|
+import { getBizTypePage, getFlowListForFilter, getMyDelegates, myPendingPage, statOverview } from './api';
|
|
|
+
|
|
|
+describe('流程管理 API 公网前缀', () => {
|
|
|
+ beforeEach(() => {
|
|
|
+ getMock.mockReset();
|
|
|
+ postMock.mockReset();
|
|
|
+ });
|
|
|
+
|
|
|
+ it('五类流程管理请求均使用配置的 API 根地址', () => {
|
|
|
+ getBizTypePage({ page: 1, pageSize: 20 });
|
|
|
+ myPendingPage({ page: 1, pageSize: 20 });
|
|
|
+ getMyDelegates();
|
|
|
+ statOverview({});
|
|
|
+ getFlowListForFilter();
|
|
|
+
|
|
|
+ expect(postMock).toHaveBeenNthCalledWith(1, '/prod-api/api/bizType/page', { page: 1, pageSize: 20 });
|
|
|
+ expect(postMock).toHaveBeenNthCalledWith(2, '/prod-api/api/flowTask/myPendingPage', { page: 1, pageSize: 20 });
|
|
|
+ expect(getMock).toHaveBeenCalledWith('/prod-api/api/flowDelegate/myList');
|
|
|
+ expect(postMock).toHaveBeenNthCalledWith(3, '/prod-api/api/flowStatistics/overview', {});
|
|
|
+ expect(postMock).toHaveBeenNthCalledWith(4, '/prod-api/api/approvalFlow/page', { page: 1, pageSize: 500 });
|
|
|
+ });
|
|
|
+});
|