test(admin): isolate merged inbound fees and shortage components
This commit is contained in:
@@ -14,7 +14,7 @@ it('provides the scoped plan facts and reloads after shortage confirmation', asy
|
|||||||
status: 'PENDING_RECONCILIATION', expectedPackageCount: 21, pickedPackageCount: 20,
|
status: 'PENDING_RECONCILIATION', expectedPackageCount: 21, pickedPackageCount: 20,
|
||||||
lineCount: 0, palletCount: 0, totalGrossWeightKg: 0, totalNetWeightKg: 0, totalVolumeCbm: 0, lines: [], pallets: [], allocations: [] }
|
lineCount: 0, palletCount: 0, totalGrossWeightKg: 0, totalNetWeightKg: 0, totalVolumeCbm: 0, lines: [], pallets: [], allocations: [] }
|
||||||
vi.mocked(getInboundPlan).mockResolvedValue(detail)
|
vi.mocked(getInboundPlan).mockResolvedValue(detail)
|
||||||
const wrapper = mount(InboundOrderDetailView, { global: { plugins: [ElementPlus], stubs: { DataTable: true, AppDialog: true } } })
|
const wrapper = mount(InboundOrderDetailView, { global: { plugins: [ElementPlus], stubs: { DataTable: true, AppDialog: true, BusinessDocumentFees: true } } })
|
||||||
await flushPromises()
|
await flushPromises()
|
||||||
expect(wrapper.findComponent({ name: 'InboundShortageConfirmation' }).props('detail')).toEqual(detail)
|
expect(wrapper.findComponent({ name: 'InboundShortageConfirmation' }).props('detail')).toEqual(detail)
|
||||||
expect(wrapper.text()).toContain('待差异核对')
|
expect(wrapper.text()).toContain('待差异核对')
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ describe('InboundOrderDetailView fees', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('uses the loaded inbound plan identity without substituting its source order', async () => {
|
it('uses the loaded inbound plan identity without substituting its source order', async () => {
|
||||||
const wrapper = mount(InboundOrderDetailView, { global: { plugins: [ElementPlus], stubs: { DataTable: true, AppDialog: true } } })
|
const wrapper = mount(InboundOrderDetailView, { global: { plugins: [ElementPlus], stubs: { DataTable: true, AppDialog: true, InboundShortageConfirmation: true } } })
|
||||||
await flushPromises()
|
await flushPromises()
|
||||||
expect(getInboundPlan).toHaveBeenCalledWith('PLAN-1', '9007199254741001')
|
expect(getInboundPlan).toHaveBeenCalledWith('PLAN-1', '9007199254741001')
|
||||||
expect(wrapper.findComponent({ name: 'BusinessDocumentFees' }).props()).toEqual({
|
expect(wrapper.findComponent({ name: 'BusinessDocumentFees' }).props()).toEqual({
|
||||||
@@ -34,7 +34,7 @@ describe('InboundOrderDetailView fees', () => {
|
|||||||
|
|
||||||
it('does not expose fee operations when the customer scope is absent', async () => {
|
it('does not expose fee operations when the customer scope is absent', async () => {
|
||||||
route.query = {}
|
route.query = {}
|
||||||
const wrapper = mount(InboundOrderDetailView, { global: { plugins: [ElementPlus], stubs: { DataTable: true, AppDialog: true } } })
|
const wrapper = mount(InboundOrderDetailView, { global: { plugins: [ElementPlus], stubs: { DataTable: true, AppDialog: true, InboundShortageConfirmation: true } } })
|
||||||
await flushPromises()
|
await flushPromises()
|
||||||
expect(getInboundPlan).not.toHaveBeenCalled()
|
expect(getInboundPlan).not.toHaveBeenCalled()
|
||||||
expect(wrapper.findComponent({ name: 'BusinessDocumentFees' }).exists()).toBe(false)
|
expect(wrapper.findComponent({ name: 'BusinessDocumentFees' }).exists()).toBe(false)
|
||||||
|
|||||||
Reference in New Issue
Block a user