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: '第二企业' }))
@@ -47,7 +47,7 @@ describe('MeasurementReviewPanel', () => {
expect(wrapper.text()).toContain('原单申报')
expect(wrapper.text()).toContain('设备实测')
expect(wrapper.text()).toContain('称重 OCR')
expect(wrapper.text()).toContain('外箱长 × 宽 × 高(cm)')
expect(wrapper.text()).toContain('实测长 × 宽 × 高(cm)')
expect(wrapper.text()).toContain('周长超过渠道限制')
expect(wrapper.text()).toContain('OCR 原文:设备屏幕原始识别内容')
expect(wrapper.text()).toContain('调整原因:去除托盘重量后采用净值')