优化
This commit is contained in:
@@ -67,9 +67,11 @@ describe('MeasurementReviewPanel', () => {
|
||||
expect(wrapper.text()).toContain('称重图片')
|
||||
expect(wrapper.text()).toContain('货物重量')
|
||||
expect(wrapper.text()).toContain('110 kg')
|
||||
expect(wrapper.text()).toContain('容量 1.2 m³')
|
||||
expect(wrapper.text()).toContain('托盘类型:木托盘')
|
||||
expect(wrapper.text()).toContain('服务端确认毛重:120 kg')
|
||||
expect(wrapper.text()).toContain('托盘皮重:10 kg')
|
||||
expect(wrapper.text()).not.toContain('TP-001')
|
||||
expect(wrapper.text()).not.toContain('申报毛重')
|
||||
expect(wrapper.text()).not.toContain('托盘皮重')
|
||||
expect(wrapper.text()).not.toContain('OCR 原文')
|
||||
expect(wrapper.text()).not.toContain('设备屏幕原始识别内容')
|
||||
expect(wrapper.text()).not.toContain('置信度')
|
||||
@@ -126,13 +128,27 @@ describe('MeasurementReviewPanel', () => {
|
||||
|
||||
expect(downloadWeightImage).toHaveBeenCalledWith('10001', '90001', 'file-1')
|
||||
const preview = document.body.querySelector('.weight-preview')
|
||||
expect(preview?.textContent).toContain('TP-001 · 木托盘')
|
||||
expect(preview?.textContent).toContain('托盘类型')
|
||||
expect(preview?.textContent).toContain('木托盘')
|
||||
expect(preview?.textContent).not.toContain('TP-001')
|
||||
expect(preview?.textContent).toContain('120 kg')
|
||||
expect(preview?.textContent).toContain('10 kg')
|
||||
expect(preview?.textContent).toContain('110 kg')
|
||||
expect(preview?.querySelector('img')?.getAttribute('src')).toBe('blob:weight-original')
|
||||
})
|
||||
|
||||
it('shows the empty pallet type explicitly without falling back to the pallet code', async () => {
|
||||
vi.mocked(getMeasurementReviewDetail).mockResolvedValueOnce({
|
||||
...detail,
|
||||
weightResults: [{ ...detail.weightResults[0], palletType: '' }],
|
||||
})
|
||||
const wrapper = mount(MeasurementReviewPanel, { props: { customerId: '10001', inboundId: '90001' }, global: { plugins: [ElementPlus] } })
|
||||
await flushPromises()
|
||||
|
||||
expect(wrapper.text()).toContain('托盘类型:未记录类型')
|
||||
expect(wrapper.text()).not.toContain('TP-001')
|
||||
})
|
||||
|
||||
it('shows the rejected release action only when the permission and rejected state exist', async () => {
|
||||
vi.mocked(getMeasurementReviewDetail).mockResolvedValue({ ...detail, processStatus: 'MEASURE_REJECTED', measureReviewStatus: 'REJECTED', reviewReason: '重量图片不清晰' })
|
||||
const wrapper = mount(MeasurementReviewPanel, { props: { customerId: '10001', inboundId: '90001' }, global: { plugins: [ElementPlus] } })
|
||||
|
||||
Reference in New Issue
Block a user