This commit is contained in:
2026-08-12 09:25:55 +08:00
parent ffb2116741
commit fb542e0b6f
24 changed files with 983 additions and 75 deletions
@@ -134,6 +134,24 @@ describe('CustomerDetailView', () => {
expect(document.body.textContent).not.toContain('计费规则尚未接入')
})
it('does not expose unknown order status codes', async () => {
const result = await listPlatformFirstLegOrders({ tenantId: String(tenant.id), page: 1, size: 10 })
vi.mocked(listPlatformFirstLegOrders).mockResolvedValueOnce({
...result,
records: result.records.map((order) => ({ ...order, status: 'LEGACY_STATUS' as PlatformFirstLegOrderResource['status'] })),
})
mount(CustomerDetailView, { attachTo: document.body, global: { plugins: [pinia, ElementPlus] } })
await flushPromises()
const ordersTab = [...document.querySelectorAll<HTMLButtonElement>('.detail-tabs button')]
.find((button) => button.textContent?.trim() === '运单记录')
ordersTab?.click()
await flushPromises()
expect(document.body.textContent).toContain('未知状态')
expect(document.body.textContent).not.toContain('LEGACY_STATUS')
})
it('opens an authenticated qualification preview', async () => {
mount(CustomerDetailView, { attachTo: document.body, global: { plugins: [pinia, ElementPlus] } })
await flushPromises()