This commit is contained in:
2026-08-07 16:25:56 +08:00
parent 628a7d781e
commit c0590ffc73
2 changed files with 14 additions and 2 deletions
@@ -148,7 +148,8 @@ 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).toContain('实测总材积重')
@@ -238,6 +239,17 @@ describe('InboundMeasurementPanel', () => {
expect(wrapper.emitted('changed')).toHaveLength(1)
})
it('blocks normal submission when confirmed box counts do not match the order total', async () => {
vi.mocked(getInboundMeasurement).mockResolvedValueOnce(measurement({ originalPackageCount: 12 }))
const wrapper = await mountPanel()
expect(wrapper.text()).toContain('确认箱数尚未与订单总箱数匹配')
expect(wrapper.text()).toContain('还差 2 箱')
const submit = wrapper.findAll('button').find((button) => button.text().includes('提交审核'))
expect(submit?.attributes('disabled')).toBeDefined()
expect(submitInboundMeasurement).not.toHaveBeenCalled()
})
it('clears the previous customer context before loading the next one', async () => {
const wrapper = await mountPanel()
vi.mocked(getInboundMeasurement).mockResolvedValueOnce(measurement({ inboundId: '7002', inboundCode: 'RK202608040002', companyName: '第二企业' }))