补齐海外出库状态展示
This commit is contained in:
@@ -12,7 +12,7 @@ vi.mock('../api/outbounds', () => ({ getOutbound: vi.fn(), cancelOutbound: vi.fn
|
||||
|
||||
describe('OutboundDetailView', () => {
|
||||
it.each([
|
||||
['WAIT_OUTBOUND', '待出库', 'warning'], ['PICKING', '拣货中', 'info'],
|
||||
['WAIT_PICK', '待拣货', 'warning'], ['WAIT_OUTBOUND', '待出库', 'warning'], ['PICKING', '拣货中', 'info'],
|
||||
['PICKED', '已拣货', 'warning'], ['OUTBOUNDED', '已出库', 'success'], ['CANCELLED', '已取消', 'danger'],
|
||||
])('uses the same shared status tone as the list for %s', async (status, label, tone) => {
|
||||
vi.mocked(getOutbound).mockResolvedValueOnce({ outbound: { id: '1', outboundNo: 'OUT/1', status }, pallets: [], deliveries: [] })
|
||||
@@ -78,8 +78,9 @@ describe('OutboundDetailView', () => {
|
||||
emptyWrapper.unmount()
|
||||
})
|
||||
|
||||
it('shows cancellation only for PICKED with the independent permission', async () => {
|
||||
it('shows cancellation only before picking with the independent permission', async () => {
|
||||
canPermission.mockImplementation((code: string) => code === 'platform:overseas-warehouse:outbound:cancel')
|
||||
vi.mocked(getOutbound).mockResolvedValueOnce({ outbound: { id: '1', outboundNo: 'OUT/1', status: 'WAIT_PICK' }, pallets: [], deliveries: [] })
|
||||
const wrapper = mount(OutboundDetailView, { global: { plugins: [ElementPlus] } })
|
||||
await flushPromises()
|
||||
expect(wrapper.text()).toContain('取消出库单')
|
||||
|
||||
@@ -19,7 +19,7 @@ class ResizeObserverStub { observe() {} unobserve() {} disconnect() {} }
|
||||
describe('OutboundsView permissions and navigation', () => {
|
||||
it('distinguishes outbound stages and does not present unknown states as picking', async () => {
|
||||
const statuses = [
|
||||
['WAIT_OUTBOUND', '待出库', 'warning'], ['PICKING', '拣货中', 'info'],
|
||||
['WAIT_PICK', '待拣货', 'warning'], ['WAIT_OUTBOUND', '待出库', 'warning'], ['PICKING', '拣货中', 'info'],
|
||||
['PICKED', '已拣货', 'warning'], ['OUTBOUNDED', '已出库', 'success'],
|
||||
['CANCELLED', '已取消', 'danger'], ['FUTURE_STATE', '未知状态', 'neutral'],
|
||||
]
|
||||
@@ -38,7 +38,7 @@ describe('OutboundsView permissions and navigation', () => {
|
||||
beforeEach(() => {
|
||||
vi.stubGlobal('ResizeObserver', ResizeObserverStub)
|
||||
vi.stubGlobal('localStorage', { getItem: () => null, setItem: () => undefined, removeItem: () => undefined })
|
||||
vi.mocked(listOutbounds).mockReset().mockResolvedValue({ records: [{ id: '1', outboundNo: 'OUT-1', dispatchNo: 'PC-1', status: 'PICKED', palletCount: 1, packageCount: 2 }], page: 1, size: 20, total: 1, pages: 1 })
|
||||
vi.mocked(listOutbounds).mockReset().mockResolvedValue({ records: [{ id: '1', outboundNo: 'OUT-1', dispatchNo: 'PC-1', status: 'WAIT_PICK', palletCount: 1, packageCount: 2 }], page: 1, size: 20, total: 1, pages: 1 })
|
||||
canPermission.mockReset().mockReturnValue(true)
|
||||
routerPush.mockReset()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user