This commit is contained in:
2026-11-03 11:43:50 +08:00
parent f8408b8076
commit 1c2dd8797a
34 changed files with 354 additions and 84 deletions
@@ -188,17 +188,17 @@ describe('单据费用操作', () => {
await flushPromises(); await click(dialog, '保存')
expect(api.createOverseasFee).not.toHaveBeenCalled()
})
it('blocks automatic storage rent from manual addition', async () => {
it('allows manual storage rent using the normal fee submission', async () => {
vi.mocked(api.listOverseasFeeItems).mockResolvedValue([{ feeCode: 'FEE_TYPE_077', feeTypeName: '仓储费', defaultPrice: null }])
const wrapper = await mountPage()
await click(wrapper, '新增费用')
const dialog = activeDialog(wrapper)
const select = dialog.findAllComponents({ name: 'ElSelect' })[0]!
expect(select.findAllComponents({ name: 'ElOption' })).toHaveLength(0)
expect(select.findAllComponents({ name: 'ElOption' })).toHaveLength(1)
select.vm.$emit('update:modelValue', 'FEE_TYPE_077')
dialog.getComponent({ name: 'ElInputNumber' }).vm.$emit('update:modelValue', 10)
await flushPromises(); await click(dialog, '保存')
expect(api.createOverseasFee).not.toHaveBeenCalled()
expect(api.createOverseasFee).toHaveBeenCalledWith(expect.objectContaining({ feeItemCode: 'FEE_TYPE_077', amount: 10 }), expect.any(String))
})
it('includes verified related orders but rejects another customer and keeps adjustment on the original order', async () => {
const related = { ...business, businessId: 'return-1', businessType: 'RETURN_ORDER' }