优化
This commit is contained in:
@@ -25,6 +25,12 @@ test('覆盖国内仓、待单、完成入库、部分和全部出库及列表
|
||||
'/inventories/${inventoryId}', 'transactions?.length === 3']) assert.match(moduleSource, new RegExp(token.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')))
|
||||
})
|
||||
|
||||
test('在创建测试数据前覆盖无筛选整柜入库列表', () => {
|
||||
const unfilteredList = '`${BASE}/inbounds?page=1&size=20`'
|
||||
assert.match(moduleSource, /无筛选查询整柜入库单列表/)
|
||||
assert.ok(moduleSource.indexOf(unfilteredList) < moduleSource.indexOf("api(context, 'POST', `${BASE}/inbounds`"))
|
||||
})
|
||||
|
||||
test('覆盖库存不足、版本冲突及两类幂等行为', () => {
|
||||
assert.match(moduleSource, /库存不足禁止出库/)
|
||||
assert.match(moduleSource, /过期库存版本冲突/)
|
||||
|
||||
@@ -22,6 +22,11 @@ async function api(context, method, path, body, token = context.token) {
|
||||
|
||||
export async function run(context) {
|
||||
const marker = context.marker.replace(/[^A-Za-z0-9]/g, '').slice(-18)
|
||||
const initialInboundsResponse = await api(context, 'GET', `${BASE}/inbounds?page=1&size=20`)
|
||||
const initialInbounds = context.apiSuccess(MODULE, '无筛选查询整柜入库单列表', initialInboundsResponse)
|
||||
context.assert(MODULE, '无筛选整柜入库列表分页结构正确', initialInboundsResponse,
|
||||
Array.isArray(initialInbounds?.records) && Number(initialInbounds?.page) === 1 && Number(initialInbounds?.size) === 20,
|
||||
`records=${initialInbounds?.records?.length ?? 'missing'}, page=${initialInbounds?.page}, size=${initialInbounds?.size}`)
|
||||
const warehousesResponse = await api(context, 'GET', '/api/platform/v1/warehouse-admin?page=1&size=200&warehouseType=DOMESTIC&status=ACTIVE')
|
||||
const warehouses = context.apiSuccess(MODULE, '查询平台启用国内仓', warehousesResponse)
|
||||
const warehouse = warehouses?.records?.[0]
|
||||
|
||||
Reference in New Issue
Block a user