feat(personal): show scanned PDF OCR progress
This commit is contained in:
@@ -95,6 +95,17 @@ test('个人资料详情包含全部状态、重试、下载和明确删除提
|
||||
assert.doesNotMatch(page, /Number\(options\?\.id|parseInt\(options\?\.id|Number\.isSafeInteger/);
|
||||
});
|
||||
|
||||
test('扫描 PDF 详情展示识别进度、部分失败和失败页重试', async () => {
|
||||
const ocr = await import('../src/services/personal-assistant-ocr.ts');
|
||||
const page = await source('../src/pages/user/assistant/item.vue');
|
||||
assert.equal(ocr.ocrProgressText({ required: true, status: 'RUNNING', totalPages: 86, processedPages: 20, successPages: 20, failedPages: 0, failedPageNumbers: [] }), '正在识别扫描 PDF:20/86 页');
|
||||
assert.equal(ocr.ocrProgressText({ required: true, status: 'PARTIAL', totalPages: 8, processedPages: 8, successPages: 6, failedPages: 2, failedPageNumbers: [3, 7] }), '已收录,2 页识别失败');
|
||||
assert.match(page, /retryPersonalOcrPages/);
|
||||
assert.match(page, /识别失败页/);
|
||||
assert.match(page, /ocrProgressPercent/);
|
||||
assert.match(page, /setTimeout/);
|
||||
});
|
||||
|
||||
test('会话页覆盖列表、详情和删除且不伪造会话', async () => {
|
||||
const page = await source('../src/pages/user/assistant/sessions.vue');
|
||||
assert.match(page, /loadPersonalSessions/);
|
||||
|
||||
Reference in New Issue
Block a user