This commit is contained in:
2026-08-14 17:38:06 +08:00
parent d1b4a4d3f3
commit 010204da57
12 changed files with 259 additions and 33 deletions
@@ -201,7 +201,7 @@ describe('InboundMeasurementPanel', () => {
expect(text).toContain('扫描箱测量数据明细')
expect(text).toContain('订单总箱数')
expect(text).toContain('确认箱数合计')
expect(text).toContain('实测总毛重')
expect(text).toContain('货物总重量')
expect(text).toContain('实测总体积')
expect(text).toContain('实测总材积重')
expect(text).not.toContain('租户')
@@ -271,6 +271,22 @@ describe('InboundMeasurementPanel', () => {
expect(getInboundMeasurement).toHaveBeenCalledTimes(1)
})
it('shows a normal A0409 business reason instead of relabeling it as a version conflict', async () => {
vi.mocked(updateConfirmedPackageCount).mockRejectedValueOnce(
new ApiResponseError('该托盘已被占用,请重新选择', 'A0409', 409),
)
const wrapper = await mountPanel()
const countInput = wrapper.find('.measurement-count-editor input')
await countInput.setValue('9')
const save = wrapper.findAll('button').find((button) => button.text().includes('保存测量数据'))
await save?.trigger('click')
await flushPromises()
expect(wrapper.text()).toContain('该托盘已被占用,请重新选择')
expect(wrapper.text()).toContain('操作未完成')
expect(wrapper.text()).not.toContain('数据版本已变化,当前修改尚未丢失')
})
it('requires the dirty draft to be saved before submitting for review', async () => {
const wrapper = await mountPanel()
const countInput = wrapper.find('.measurement-count-editor input')