fix(appointments): show authoritative timezone and business source

This commit is contained in:
2026-10-10 18:38:08 +08:00
parent 7f39adf9f5
commit ebff6f8167
5 changed files with 28 additions and 8 deletions
@@ -15,9 +15,22 @@ describe('appointment impact handling', () => {
expect(wrapper.text()).toContain('2026-10-17T09:00:00')
expect(wrapper.text()).toContain('2026-10-16T09:00:00')
expect(wrapper.text()).toContain('无车次查看权限')
expect(wrapper.text()).toContain('来源:carrier')
expect(wrapper.text()).toContain('核对原因:到港预测变化')
expect(wrapper.text()).not.toContain('认领跟进')
expect(handleImpact).not.toHaveBeenCalled(); wrapper.unmount()
})
it('labels manual observations without exposing internal operator references and explains missing forecasts', async () => {
vi.mocked(getImpact).mockResolvedValueOnce({ ...detail, impact: { ...detail.impact, reason: 'FORECAST_MISSING', latest: { ...detail.impact.latest!, providerCode: 'MANUAL', sourceReference: 'MANUAL:1000001', estimatedAt: null } } })
const wrapper = render(); await flushPromises()
expect(wrapper.text()).toContain('来源:人工维护')
expect(wrapper.text()).toContain('来源预计到港缺失,待核实')
expect(wrapper.text()).not.toContain('1000001')
expect(wrapper.text()).not.toContain('MANUAL:')
expect(wrapper.text()).not.toContain('已延误')
expect(wrapper.text()).toContain('认领跟进')
expect(handleImpact).not.toHaveBeenCalled(); wrapper.unmount()
})
it('freezes an uncertain command and retries exactly once with original version and key', async () => {
vi.mocked(handleImpact).mockRejectedValueOnce(new Error('connection lost')).mockResolvedValueOnce({ ...detail.impact, version: 2 })
const wrapper = render(); await flushPromises()