再次提交一下代码
This commit is contained in:
@@ -651,6 +651,90 @@ describe('ReservationTaskDetailPanel', () => {
|
||||
expect(wrapper.text()).not.toContain('接口待补')
|
||||
})
|
||||
|
||||
it('renders source email preview with excerpt, attachments and full conversation entry', async () => {
|
||||
vi.mocked(service.fetchReservationTaskDetail).mockResolvedValue(
|
||||
createTaskDetail({
|
||||
fields: [
|
||||
createRequiredField({
|
||||
field_path: 'relevant_message_excerpt',
|
||||
display_name: '邮件片段',
|
||||
value: 'LLT260509FA213 11-13/05/2026 2N 14 TWN +1 DBL',
|
||||
editable: 'N',
|
||||
input_editable: 'N',
|
||||
required_rule: null,
|
||||
control_type: 'evidence_text',
|
||||
edit_scope: 'never',
|
||||
write_target: 'none',
|
||||
raw_readonly: true,
|
||||
} as Partial<ReservationTaskFieldResult>),
|
||||
createRequiredField({
|
||||
field_path: 'source_message.attachments',
|
||||
display_name: '来源附件',
|
||||
value: [
|
||||
{
|
||||
id: 'att-1',
|
||||
name: 'WYNDHAM LIANTAI 2026 UPDATE BOOKING 12-05-2026 NO.1.xlsx',
|
||||
content_type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
size_bytes: 2048,
|
||||
},
|
||||
],
|
||||
editable: 'N',
|
||||
input_editable: 'N',
|
||||
file_display: 'Y',
|
||||
required_rule: null,
|
||||
control_type: 'file',
|
||||
edit_scope: 'never',
|
||||
write_target: 'none',
|
||||
raw_readonly: true,
|
||||
} as Partial<ReservationTaskFieldResult>),
|
||||
],
|
||||
}),
|
||||
)
|
||||
|
||||
const wrapper = await mountPanel()
|
||||
|
||||
expect(wrapper.text()).toContain('来源邮件预览')
|
||||
expect(wrapper.text()).toContain('Booking Request')
|
||||
expect(wrapper.text()).toContain('guest@example.test')
|
||||
expect(wrapper.text()).toContain('2026-07-08 10:00:00')
|
||||
expect(wrapper.text()).toContain('LLT260509FA213 11-13/05/2026 2N 14 TWN +1 DBL')
|
||||
expect(wrapper.text()).toContain('WYNDHAM LIANTAI 2026 UPDATE BOOKING 12-05-2026 NO.1.xlsx')
|
||||
expect(wrapper.text()).toContain('查看完整邮件会话')
|
||||
expect(wrapper.text()).not.toContain('{"id":"att-1"')
|
||||
})
|
||||
|
||||
it('does not surface source email excerpt or attachments from unexposed backend context', async () => {
|
||||
vi.mocked(service.fetchReservationTaskDetail).mockResolvedValue(
|
||||
createTaskDetail({
|
||||
fields: [],
|
||||
context_used: {
|
||||
relevant_message_excerpt: 'Hidden context excerpt',
|
||||
attachments: [
|
||||
{
|
||||
name: 'hidden-context-attachment.pdf',
|
||||
},
|
||||
],
|
||||
},
|
||||
manual_review: {
|
||||
attachments: [
|
||||
{
|
||||
name: 'hidden-review-attachment.pdf',
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
)
|
||||
|
||||
const wrapper = await mountPanel()
|
||||
const sourceEmailPreview = wrapper.find('.task-source-email')
|
||||
|
||||
expect(sourceEmailPreview.text()).toContain('暂无邮件片段')
|
||||
expect(sourceEmailPreview.text()).not.toContain('Hidden context excerpt')
|
||||
expect(sourceEmailPreview.text()).not.toContain('hidden-context-attachment.pdf')
|
||||
expect(sourceEmailPreview.text()).not.toContain('hidden-review-attachment.pdf')
|
||||
expect(sourceEmailPreview.text()).not.toContain('相关附件')
|
||||
})
|
||||
|
||||
it('renders source-message-only entry result without editable or OPERA actions', async () => {
|
||||
vi.mocked(service.fetchReservationTaskDetail).mockResolvedValue(createSourceMessageOnlyTaskDetail())
|
||||
|
||||
|
||||
@@ -397,8 +397,11 @@ describe('reservation P0 views', () => {
|
||||
const wrapper = await mountWithPlugins(ReservationOrderListView)
|
||||
await vi.dynamicImportSettled()
|
||||
|
||||
const rowText = wrapper.find('tbody').text()
|
||||
expect(wrapper.text()).toContain('GRP-001')
|
||||
expect(wrapper.text()).toContain('有效')
|
||||
expect(rowText).not.toContain('20001')
|
||||
expect(rowText).not.toContain('有效')
|
||||
expect(wrapper.text()).not.toContain('未关闭任务')
|
||||
expect(wrapper.text()).toContain('继续处理')
|
||||
expect(wrapper.text()).not.toContain('接口待接入')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user