优化
This commit is contained in:
@@ -77,6 +77,43 @@ test('relabel API covers claim, unit outcomes, completion and review with encode
|
||||
assert.ok(calls.every((call) => !/[?&](?:customerId|warehouseId)=/.test(call.url)))
|
||||
})
|
||||
|
||||
test('carton relabel uses one scan input and shows the confirmed FBA mapping after saving', async () => {
|
||||
const page = await read('../src/pages/relabel/relabel.vue')
|
||||
assert.equal((page.match(/name="quickCarton"/g) || []).length, 1)
|
||||
assert.match(page, /v-if="taskTab === 'sku' && selectedItem && remaining\(selectedItem\) > 0"/)
|
||||
assert.match(page, /selectItem\(item\) \{ if \(this\.taskTab === 'carton'\) \{ this\.activeTarget = 'quick-carton'; return \}/)
|
||||
const start = page.indexOf('async submitCarton(raw)')
|
||||
const scan = page.slice(start, page.indexOf('removePhoto(index)', start))
|
||||
assert.ok(scan.indexOf('await scanRelabelCarton') < scan.indexOf('this.applyCurrent(result)'))
|
||||
assert.ok(scan.indexOf('this.applyCurrent(result)') < scan.indexOf('uni.showModal'))
|
||||
assert.match(scan, /showCancel: false/)
|
||||
assert.match(scan, /confirmedItem\?\.fbaCartonMark/)
|
||||
})
|
||||
|
||||
test('relabel list opens a row directly in execution and completion returns to the list', async () => {
|
||||
const page = await read('../src/pages/relabel/relabel.vue')
|
||||
assert.doesNotMatch(page, /name="relabelTask"/)
|
||||
assert.match(page, /@tap="openExecution\(item\)"/)
|
||||
assert.match(page, /async openExecution\(item\)/)
|
||||
assert.match(page, /uni\.redirectTo\(\{ url: '\/pages\/relabel\/relabel\?op=relabelExecute' \}\)/)
|
||||
assert.match(page, /当前账号正在执行 \$\{active\.relabelNo\}/)
|
||||
assert.match(page, /v-if="stage === 'execute'" class="work-card"><button class="secondary"[^>]*@tap="goToClaimList">返回换标列表<\/button>/)
|
||||
assert.match(page, /updateWarehouseWork\('relabel', \{ currentNo: '', photoFileIds: \[\], photoNames: \[\], remark: '' \}\)/)
|
||||
assert.match(page, /if \(completed\) this\.goToClaimList\(\)/)
|
||||
assert.match(page, /goToClaimList\(\) \{ this\.taskCode = ''; uni\.redirectTo\(\{ url: '\/pages\/relabel\/relabel\?op=relabelReceive' \}\) \}/)
|
||||
})
|
||||
|
||||
test('relabel review is a read-only list and completed execution details stay hidden', async () => {
|
||||
const page = await read('../src/pages/relabel/relabel.vue')
|
||||
assert.match(page, /showCurrent\(\) \{ if \(!this\.current \|\| this\.stage === 'review'\) return false; if \(this\.stage === 'execute'\) return this\.current\.taskStatus === 'PROCESSING' && this\.current\.claimedByCurrentOperator/)
|
||||
assert.match(page, /stageSubtitle\(\) \{ return this\.stage === 'review' \? '仅展示当前仓库已完成现场换标并等待复核的单据'/)
|
||||
const reviewList = page.slice(page.indexOf('<view v-else class="task-list">'), page.indexOf('<view v-if="showCurrent"'))
|
||||
assert.doesNotMatch(reviewList, /@tap|详情/)
|
||||
assert.match(page, /<button v-if="stage !== 'review'" class="link-button"[^>]*@tap="loadCandidates"/)
|
||||
assert.match(page, /if \(this\.stage === 'execute'\) this\.startScanner\(\)/)
|
||||
assert.match(page, /if \(this\.stage === 'execute' && this\.taskCode\) await this\.openTask/)
|
||||
})
|
||||
|
||||
test('warehouse drafts are isolated by operator and warehouse and retain retry keys until success', () => {
|
||||
const values = new Map()
|
||||
globalThis.uni = {
|
||||
|
||||
Reference in New Issue
Block a user