前端调整V4预订事项用户化展示

This commit is contained in:
andy committed 2026-07-21 20:54:24 +07:00
1 parent 350bb3310b
commit c521eb6dc0
20 files changed
+703 -657

No files matched your search

+53 -33
View File
@@ -570,32 +570,36 @@ describe('reservation P0 views', () => {
vi.mocked(service.fetchSourceMessageConversation).mockReset()
})
it('renders the V4 order overview, next action, related source messages and safe card timeline', async () => {
it('renders the user-facing order overview, next action, related source emails and processing records', async () => {
vi.mocked(service.fetchReservationOrderDetail).mockResolvedValue(createOrderDetailResult())
const wrapper = await mountWithPlugins(ReservationOrderDetailView, '/reservation/orders/20001')
await vi.dynamicImportSettled()
expect(wrapper.text()).toContain('V4 当前确认快照')
expect(wrapper.text()).toContain('订单信息总览')
expect(wrapper.text()).toContain('QBD_TRAVEL')
expect(wrapper.text()).toContain('Q.B.D. TRAVEL GROUP CO., LTD')
expect(wrapper.text()).toContain('2026-07-26')
expect(wrapper.text()).toContain('2026-07-29')
expect(wrapper.text()).toContain('RM1 × 2')
expect(wrapper.text()).toContain('下一步处理')
expect(wrapper.find('a[href="/reservation/order-tasks/9001"]').text()).toContain('进入处理页')
expect(wrapper.find('a[href="/reservation/order-tasks/9001"]').text()).toContain('进入办理页')
expect(wrapper.find('.primary-link[href="/reservation/order-tasks/9001"]').exists()).toBe(true)
expect(wrapper.text()).toContain('关联来源消息')
expect(wrapper.text()).toContain('关联来源邮件')
expect(wrapper.text()).toContain('v4@example.test')
expect(wrapper.text()).toContain('查看邮件会话')
expect(wrapper.find('a[href="/reservation/source-messages/30003/conversation"]').exists()).toBe(true)
expect(wrapper.text()).toContain(zhCN.order.v4TaskTimeline)
expect(wrapper.text()).toContain('order-ref-1')
expect(wrapper.text()).toContain('处理记录')
expect(wrapper.text()).not.toContain('order-ref-1')
expect(wrapper.text()).toContain('V4 Booking Package')
expect(wrapper.find('.v4-timeline-item__main[href="/reservation/order-tasks/9001"]').exists()).toBe(true)
expect(wrapper.text()).toContain('基础信息卡')
expect(wrapper.text()).toContain('事项状态摘要')
expect(wrapper.text()).toContain('预订基础信息')
expect(wrapper.text()).toContain('frontend-query-admin')
expect(wrapper.text()).toContain('待复核')
expect(wrapper.text()).not.toContain('V4 当前确认快照')
expect(wrapper.text()).not.toContain('任务卡编号')
expect(wrapper.text()).not.toContain('card-basic')
expect(wrapper.text()).not.toContain('unsafe ai payload must stay hidden')
expect(wrapper.text()).not.toContain('unsafe display payload must stay hidden')
expect(wrapper.text()).not.toContain('unsafe confirmed payload must stay hidden')
@@ -622,9 +626,9 @@ describe('reservation P0 views', () => {
const wrapper = await mountWithPlugins(ReservationOrderDetailView, '/reservation/orders/20001')
await vi.dynamicImportSettled()
expect(wrapper.text()).toContain('暂无已确认的 V4 订单快照')
expect(wrapper.text()).toContain('暂无下一步 V4 处理动作')
expect(wrapper.text()).toContain('暂无关联来源消息')
expect(wrapper.text()).toContain('暂无已确认的订单信息')
expect(wrapper.text()).toContain('暂无下一步处理事项')
expect(wrapper.text()).toContain('暂无关联来源邮件')
expect(wrapper.text()).toContain(zhCN.order.v4TaskTimelineEmpty)
expect(wrapper.find('a[href^="/reservation/order-tasks/"]').exists()).toBe(false)
})
@@ -830,10 +834,11 @@ describe('reservation P0 views', () => {
expect(wrapper.text()).toContain('GRP-001')
expect(wrapper.text()).toContain('Booking Request')
expect(wrapper.text()).toContain('订单任务')
expect(wrapper.text()).toContain('预订事项')
expect(wrapper.text()).toContain('待确认 1')
expect(wrapper.text()).toContain('待复核 1')
expect(wrapper.text()).toContain('查看邮件会话')
expect(wrapper.text()).not.toContain('#9001')
expect(wrapper.text()).not.toContain('接口待补')
expect(service.fetchReservationV4WorkbenchItems).toHaveBeenCalledWith(
expect.objectContaining({
@@ -866,10 +871,12 @@ describe('reservation P0 views', () => {
expect(wrapper.text()).toContain('待确认已读')
expect(wrapper.text()).toContain('查看通知')
expect(wrapper.text()).toContain('查看邮件会话')
expect(wrapper.text()).toContain('该邮件不关联订单,请查看邮件内容。')
expect(wrapper.text()).not.toContain('S10/S99')
expect(wrapper.text()).not.toContain('查看订单')
})
it('filters V4 workbench with supported backend fields only', async () => {
it('filters the reservation workbench with user-facing filter choices only', async () => {
vi.mocked(service.fetchReservationV4WorkbenchItems)
.mockResolvedValueOnce(createV4WorkbenchResult('GRP-001', 'Booking Request', { page_num: 1, page_size: 20, total: 45 }))
.mockResolvedValueOnce(createV4SourceNotificationWorkbenchResult('S10'))
@@ -877,14 +884,18 @@ describe('reservation P0 views', () => {
const wrapper = await mountWithPlugins(ReservationTaskListView)
await vi.dynamicImportSettled()
const itemTypeOptions = wrapper.find('select[name="item_type"]').findAll('option')
const itemTypeOptions = wrapper.find('select[name="business_status"]').findAll('option')
.map((option) => option.attributes('value'))
expect(itemTypeOptions).toEqual(['', 'ORDER_TASK', 'SOURCE_NOTIFICATION'])
expect(wrapper.find('select[name="item_type"]').text()).toContain('来源通知')
expect(wrapper.find('select[name="item_type"]').text()).not.toContain('INFORMATIONAL_MESSAGE')
expect(itemTypeOptions).toEqual(['', 'PENDING_CONFIRM', 'REVIEW_REQUIRED', 'COMPLETED', 'SOURCE_NOTIFICATION'])
expect(wrapper.find('select[name="business_status"]').text()).toContain('来源通知')
expect(wrapper.find('select[name="business_status"]').text()).not.toContain('ORDER_TASK')
expect(wrapper.find('select[name="business_status"]').text()).not.toContain('SOURCE_NOTIFICATION')
expect(wrapper.find('select[name="item_type"]').exists()).toBe(false)
expect(wrapper.find('select[name="order_task_status"]').exists()).toBe(false)
expect(wrapper.find('select[name="card_status"]').exists()).toBe(false)
await wrapper.find('select[name="item_type"]').setValue('SOURCE_NOTIFICATION')
await wrapper.find('select[name="business_status"]').setValue('SOURCE_NOTIFICATION')
await vi.dynamicImportSettled()
expect(service.fetchReservationV4WorkbenchItems).toHaveBeenLastCalledWith(
@@ -903,35 +914,45 @@ describe('reservation P0 views', () => {
expect(lastTaskRequest).not.toHaveProperty('route_code')
})
it('filters and paginates V4 business order tasks with supported backend fields', async () => {
it('shows a filter-specific empty state for completed reservation items', async () => {
vi.mocked(service.fetchReservationV4WorkbenchItems)
.mockResolvedValueOnce(createV4WorkbenchResult('GRP-001', 'Booking Request'))
vi.mocked(service.fetchReservationV4OrderTasks)
.mockResolvedValueOnce({
items: [],
page: {
page_num: 1,
page_size: 20,
total: 0,
},
})
const wrapper = await mountWithPlugins(ReservationTaskListView)
await vi.dynamicImportSettled()
await wrapper.find('select[name="business_status"]').setValue('COMPLETED')
await vi.dynamicImportSettled()
expect(wrapper.text()).toContain('暂无已完成的预订事项')
expect(wrapper.text()).not.toContain('暂无需要处理的预订事项')
})
it('filters and paginates reservation work items with supported backend fields', async () => {
vi.mocked(service.fetchReservationV4WorkbenchItems)
.mockResolvedValueOnce(createV4WorkbenchResult('GRP-001', 'Booking Request', { page_num: 1, page_size: 20, total: 45 }))
vi.mocked(service.fetchReservationV4OrderTasks)
.mockResolvedValueOnce(createV4OrderTaskListResult('GRP-001', 'Booking Request', { page_num: 1, page_size: 20, total: 45 }))
.mockResolvedValueOnce(createV4OrderTaskListResult('GRP-001', 'Booking Request', { page_num: 1, page_size: 20, total: 45 }))
.mockResolvedValueOnce(createV4OrderTaskListResult('GRP-001', 'Booking Request', { page_num: 1, page_size: 20, total: 45 }))
.mockResolvedValueOnce(createV4OrderTaskListResult('GRP-002', 'Booking Update', { page_num: 2, page_size: 20, total: 45 }))
const wrapper = await mountWithPlugins(ReservationTaskListView)
await vi.dynamicImportSettled()
expect(wrapper.find('select[name="order_task_status"]').attributes('disabled')).toBeDefined()
expect(wrapper.find('select[name="card_status"]').attributes('disabled')).toBeDefined()
await wrapper.find('select[name="item_type"]').setValue('ORDER_TASK')
await vi.dynamicImportSettled()
expect(wrapper.find('select[name="order_task_status"]').attributes('disabled')).toBeUndefined()
expect(wrapper.find('select[name="card_status"]').attributes('disabled')).toBeUndefined()
await wrapper.find('select[name="order_task_status"]').setValue('OPEN')
await vi.dynamicImportSettled()
await wrapper.find('select[name="card_status"]').setValue('REVIEW_REQUIRED')
await wrapper.find('select[name="business_status"]').setValue('REVIEW_REQUIRED')
await vi.dynamicImportSettled()
const taskListCalls = vi.mocked(service.fetchReservationV4OrderTasks).mock.calls
const filteredTaskRequest = taskListCalls[taskListCalls.length - 1]?.[0] ?? {}
expect(filteredTaskRequest).toMatchObject({
order_task_status: 'OPEN',
card_status: 'REVIEW_REQUIRED',
page_num: 1,
})
@@ -941,7 +962,6 @@ describe('reservation P0 views', () => {
expect(service.fetchReservationV4OrderTasks).toHaveBeenLastCalledWith(
expect.objectContaining({
order_task_status: 'OPEN',
card_status: 'REVIEW_REQUIRED',
page_num: 2,
page_size: 20,