This commit is contained in:
2026-09-10 15:33:54 +08:00
parent e428002898
commit aaca62f461
7 changed files with 212 additions and 23 deletions
@@ -39,15 +39,27 @@ describe('OutboundsView permissions and navigation', () => {
canPermission.mockImplementation((code: string) => ['platform:overseas-warehouse:outbound:create', 'platform:overseas-warehouse:outbound:cancel'].includes(code))
const wrapper = mount(OutboundsView, { global: { plugins: [ElementPlus] } })
await flushPromises()
expect(wrapper.text()).toContain('一件代发出库')
expect(wrapper.text()).toContain('新建出库单')
expect(wrapper.text()).toContain('取消')
wrapper.unmount()
})
it('requires an explicit customer selection before choosing customer inventory', async () => {
it('loads one-click candidates across customers and loads return inventory after customer selection', async () => {
const source = readFileSync(resolve(process.cwd(), 'src/modules/overseas-warehouse/pages/OutboundsView.vue'), 'utf8')
expect(source).toContain('v-model="selectedCustomerId"')
expect(source).toContain('availablePositionOptions')
expect(source).toContain('createOneClickDropshipOutbound(selectedCustomerId.value')
expect(source).toContain('listOneClickOutboundCandidates(selectedCustomerId.value || undefined')
expect(source).toContain('if (selectedCustomerId.value && selectedWarehouseId.value) await loadReturnCandidates()')
expect(source).toContain("createOneClickDropshipOutbound([...customerIds][0] || ''")
})
it('applies batched return filters only through explicit search and exposes page sizes', () => {
const source = readFileSync(resolve(process.cwd(), 'src/modules/overseas-warehouse/pages/OutboundsView.vue'), 'utf8')
expect(source).toContain('returnSkuQueryInput')
expect(source).toContain('returnCartonQueryInput')
expect(source).toContain("item.replace(/\\s+/g, '')")
expect(source).toContain('@click="searchReturnSkus"')
expect(source).toContain('@click="searchReturnCartons"')
expect(source).toContain(':page-sizes="[5, 10, 20, 50]"')
expect(source).toContain('width="min(1320px, calc(100vw - 32px))"')
})
})