fix(overseas): show inventory business reference
This commit is contained in:
@@ -64,7 +64,31 @@ describe('inventory customer-name snapshots', () => {
|
||||
await flushPromises()
|
||||
expect(wrapper.text()).toContain('华远贸易')
|
||||
expect(wrapper.text()).toContain('洛杉矶仓')
|
||||
expect(wrapper.text()).toContain('入库单号')
|
||||
expect(wrapper.text()).toContain(balance.inboundOrderNo)
|
||||
expect(wrapper.text()).toContain('美本土散板')
|
||||
expect(wrapper.text()).not.toContain('美本土散版')
|
||||
expect(wrapper.text()).not.toContain('ONT8目的仓')
|
||||
expect(wrapper.text()).not.toContain(customerId)
|
||||
expect(wrapper.text()).not.toContain(balance.id)
|
||||
})
|
||||
|
||||
it('falls back to the inbound code and then an explicit empty business reference without exposing the inventory id', async () => {
|
||||
vi.mocked(listInventoryBalances).mockResolvedValueOnce({ records: [{ ...balance, inboundOrderNo: '' }], page: 1, size: 10, total: 1, pages: 1 })
|
||||
routing.route.params = { inventoryId: balance.id }
|
||||
routing.route.query = { inboundCode: balance.inboundCode, skuCode: balance.skuCode }
|
||||
const inboundCodeWrapper = mount(InventoryDetailView, { attachTo: document.body, global: { plugins: [createPinia(), ElementPlus] } })
|
||||
await flushPromises()
|
||||
expect(inboundCodeWrapper.text()).toContain('入仓码')
|
||||
expect(inboundCodeWrapper.text()).toContain(balance.inboundCode)
|
||||
expect(inboundCodeWrapper.text()).not.toContain(balance.id)
|
||||
|
||||
inboundCodeWrapper.unmount()
|
||||
vi.mocked(listInventoryBalances).mockResolvedValueOnce({ records: [{ ...balance, inboundOrderNo: '', inboundCode: '' }], page: 1, size: 10, total: 1, pages: 1 })
|
||||
routing.route.query = { skuCode: balance.skuCode }
|
||||
const emptyWrapper = mount(InventoryDetailView, { attachTo: document.body, global: { plugins: [createPinia(), ElementPlus] } })
|
||||
await flushPromises()
|
||||
expect(emptyWrapper.text()).toContain('业务标识')
|
||||
expect(emptyWrapper.text()).not.toContain(balance.id)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user