feat(file-check): 增加文件检核 Excel 下载链接解析与展示功能
This commit is contained in:
1 parent
5e7e5a8717
commit
f21216f81e
21 files changed
+885
-125
No files matched your search
@@ -0,0 +1,24 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import {
|
||||
parseFileCheckExcelRunId,
|
||||
rewriteFileCheckExcelLinksForDisplay,
|
||||
} from './fileCheckExcelDownload';
|
||||
|
||||
describe('fileCheckExcelDownload', () => {
|
||||
it('parses tool api excel link with token', () => {
|
||||
expect(parseFileCheckExcelRunId(
|
||||
'http://192.168.100.230:8890/api/file-check/tools/runs/187/excel?token=abc',
|
||||
)).toBe(187);
|
||||
});
|
||||
|
||||
it('parses workspace excel link', () => {
|
||||
expect(parseFileCheckExcelRunId('/api/workspace/file-check/runs/42/excel')).toBe(42);
|
||||
});
|
||||
|
||||
it('rewrites tool api links to workspace paths for display', () => {
|
||||
const input = '下载:[链接](http://ai.example.com/api/file-check/tools/runs/9/excel?token=xyz)';
|
||||
expect(rewriteFileCheckExcelLinksForDisplay(input)).toBe(
|
||||
'下载:[链接](/api/workspace/file-check/runs/9/excel)',
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user