适配来源消息只读任务展示

This commit is contained in:
andy
2026-07-10 19:38:13 +08:00
parent bbd4ea22df
commit 1efa819599
11 changed files with 324 additions and 14 deletions

View File

@@ -66,6 +66,35 @@ function createTaskDetail(overrides: Partial<ReservationTaskDetailResult> = {}):
}
}
function createSourceMessageOnlyTaskDetail(
overrides: Partial<ReservationTaskDetailResult> = {},
): ReservationTaskDetailResult {
return createTaskDetail({
system_task_type: 'SOURCE_MESSAGE_ONLY',
task_card_type: 'SOURCE_MESSAGE_ONLY',
task_status: 'COMPLETED',
fields: [],
opera_operations: [],
availability: {
blocked: false,
read_only: true,
editable: false,
confirmable: false,
executable: false,
blocked_by_task_id: null,
blocked_reason: null,
},
source_message_only_result: {
entry_result_code: 'S000',
entry_result_meaning: 'PURE_INFORMATION',
entry_result_description: '纯信息类邮件',
entry_result_source_message_id: '30001',
raw_answer: 'S000,30001',
},
...overrides,
})
}
function createMutationResult(taskStatus = 'PENDING_CONFIRM'): ReservationTaskPayloadMutationResult {
return {
task_id: '10001',
@@ -428,6 +457,29 @@ describe('ReservationTaskDetailPanel', () => {
expect(wrapper.text()).not.toContain('接口待补')
})
it('renders source-message-only entry result without editable or OPERA actions', async () => {
vi.mocked(service.fetchReservationTaskDetail).mockResolvedValue(createSourceMessageOnlyTaskDetail())
const wrapper = await mountPanel()
expect(wrapper.text()).toContain('来源消息只读')
expect(wrapper.text()).toContain('来源消息入口结果')
expect(wrapper.text()).toContain('该任务仅用于展示来源消息入口结果')
expect(wrapper.text()).toContain('S000')
expect(wrapper.text()).toContain('PURE_INFORMATION')
expect(wrapper.text()).toContain('纯信息类邮件')
expect(wrapper.text()).toContain('S000,30001')
expect(wrapper.text()).toContain('查看邮件会话')
expect(wrapper.text()).not.toContain('查看订单')
expect(wrapper.text()).not.toContain('保存草稿')
expect(wrapper.text()).not.toContain('确认任务')
expect(wrapper.text()).not.toContain('人工转换')
expect(wrapper.text()).not.toContain('OPERA 模拟操作')
expect(wrapper.text()).not.toContain('确认任务后生成 OPERA 模拟操作')
expect(wrapper.find('button[title="执行"]').exists()).toBe(false)
expect(wrapper.find('button[title="重试"]').exists()).toBe(false)
})
it('converts a manual review task to a new booking without a target order', async () => {
vi.mocked(service.fetchReservationTaskDetail)
.mockResolvedValueOnce(