优化
This commit is contained in:
@@ -31,6 +31,19 @@ describe('container fee API', () => {
|
||||
expect(listSuppliers).toHaveBeenCalledWith({ status: 'ACTIVE', category: 'TRUCKING', page: 1, size: 200 })
|
||||
})
|
||||
|
||||
it('loads every ACTIVE supplier without a category filter when the fee item category is empty', async () => {
|
||||
vi.mocked(listSuppliers).mockResolvedValue({ records: [
|
||||
{ id: '41', name: '承运商A', status: 'ACTIVE', category: 'TRUCKING' },
|
||||
{ id: '42', name: '停用承运商', status: 'INACTIVE', category: 'TRUCKING' },
|
||||
{ id: '43', name: '报关行', status: 'ACTIVE', category: 'CUSTOMS' },
|
||||
], page: 1, size: 200, total: 3, pages: 1 } as never)
|
||||
await expect(listContainerFeeSupplierOptions(null)).resolves.toEqual([
|
||||
{ id: '41', supplierName: '承运商A', category: 'TRUCKING' },
|
||||
{ id: '43', supplierName: '报关行', category: 'CUSTOMS' },
|
||||
])
|
||||
expect(listSuppliers).toHaveBeenCalledWith({ status: 'ACTIVE', category: undefined, page: 1, size: 200 })
|
||||
})
|
||||
|
||||
it('reads allocation rows from Finance and never calculates them', async () => {
|
||||
const get = vi.spyOn(http, 'get')
|
||||
.mockResolvedValueOnce({ code: '200', data: [{ id: 81, customerId: 11, containerId: 99 }, { id: 82, customerId: 11, containerId: 100 }] })
|
||||
|
||||
Reference in New Issue
Block a user