26 lines
1.3 KiB
JavaScript
26 lines
1.3 KiB
JavaScript
import assert from 'node:assert/strict'
|
|||
|
|
import { readFileSync } from 'node:fs'
|
||
|
|
import test from 'node:test'
|
||
|
|
|
||
|
|
const view = readFileSync(new URL('./WarehouseServiceView.vue', import.meta.url), 'utf8')
|
||
|
|
const api = readFileSync(new URL('../api/warehouseServices.ts', import.meta.url), 'utf8')
|
||
|
|
|
||
|
|
test('仓储转运先选择入仓方式并按方式切换地址信息', () => {
|
||
|
|
assert.match(view, /value="WAREHOUSE_PICKUP">仓库上门提货/)
|
||
|
|
assert.match(view, /value="CUSTOMER_DELIVERY">客户送货到仓/)
|
||
|
|
assert.match(view, /form\.deliveryMethod === 'WAREHOUSE_PICKUP'.*提货地址/s)
|
||
|
|
assert.match(view, /form\.deliveryMethod === 'CUSTOMER_DELIVERY'.*送货地址.*收货联系人.*联系电话/s)
|
||
|
|
assert.match(view, /getMerchantWarehouseDetail\(form\.warehouse\)/)
|
||
|
|
})
|
||
|
|
|
||
|
|
test('仓储转运允许暂未确定 FBA 去向并显式选择是否换标', () => {
|
||
|
|
assert.match(view, /是否已有 FBA 去向/)
|
||
|
|
assert.match(view, /:value="false">暂未确定/)
|
||
|
|
assert.match(view, /transferHasFbaDestination.*目的 FBA 仓/s)
|
||
|
|
assert.match(view, /是否需要换标/)
|
||
|
|
assert.match(view, /:value="false">不需要换标/)
|
||
|
|
assert.match(view, /:value="true">需要换标/)
|
||
|
|
assert.match(api, /fbaWarehouseCode\?: string/)
|
||
|
|
assert.match(api, /fbaShipmentNo\?: string/)
|
||
|
|
})
|