fix(pda): 修复海外PDA真机作业并固定APK与热更新发布流程
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import { readFileSync } from 'node:fs'
|
||||
import test from 'node:test'
|
||||
import { parse, compileStyle, compileTemplate } from '@vue/compiler-sfc'
|
||||
|
||||
const read = (relative) => readFileSync(new URL(relative, import.meta.url), 'utf8')
|
||||
const page = read('../src/pages/operation/operation.vue')
|
||||
@@ -91,10 +92,34 @@ test('domestic cabinet photos are read-only, previewable and non-blocking in sig
|
||||
})
|
||||
|
||||
test('receiving finish action remains in document flow after the scan and save controls', () => {
|
||||
assert.match(page, /v-if="canFinishOnsite" class="sticky-action-dock"><view class="sticky-action one"/)
|
||||
assert.match(page, /v-if="canFinishOnsite" class="receiving-finish-card"/)
|
||||
assert.match(page, /allInboundsReconciled \? '完成整柜入库' : '现场收货结束(标记差异)'/)
|
||||
assert.match(page, /sticky-action-dock\{position:static;max-width:none/)
|
||||
assert.match(page, /receiving-content-with-action\{[^}]*padding-bottom:calc\(24px \+ env\(safe-area-inset-bottom,0px\)\)/)
|
||||
assert.ok(page.indexOf('class="receiving-finish-card"') > page.indexOf('@tap="submitReceipt"'))
|
||||
assert.match(page, /:class="allInboundsReconciled \? 'primary-button' : 'secondary-button'"/)
|
||||
assert.match(page, /receiving-content\{[^}]*padding-bottom:calc\(24px \+ env\(safe-area-inset-bottom,0px\)\)/)
|
||||
assert.match(page, /primary-button,\.secondary-button,\.ghost-button\{[^}]*align-items:center;justify-content:center[^}]*line-height:normal;text-align:center/)
|
||||
assert.match(page, /sticky-action button\{[^}]*align-items:center;justify-content:center;line-height:normal;text-align:center/)
|
||||
const { descriptor, errors } = parse(page)
|
||||
assert.deepEqual(errors, [])
|
||||
const style = compileStyle({ source: descriptor.styles[0].content, filename: 'operation.vue', id: 'receiving', scoped: true })
|
||||
assert.deepEqual(style.errors, [])
|
||||
const dockPositions = []
|
||||
style.rawResult.root.walkRules(rule => {
|
||||
if (rule.selector.includes('.sticky-action-dock')) rule.walkDecls('position', declaration => dockPositions.push(declaration.value))
|
||||
if (rule.selector.includes('.receiving-finish-card')) rule.walkDecls('position', declaration => assert.equal(declaration.value, 'static'))
|
||||
})
|
||||
assert.deepEqual(dockPositions, ['static'])
|
||||
})
|
||||
|
||||
test('pallet quantity input reserves room above the keyboard and confirms through receipt submission', () => {
|
||||
const { descriptor, errors } = parse(page)
|
||||
assert.deepEqual(errors, [])
|
||||
const compiled = compileTemplate({ source: descriptor.template.content, filename: 'operation.vue', id: 'receiving' })
|
||||
assert.deepEqual(compiled.errors, [])
|
||||
const quantityInput = descriptor.template.content.match(/<input[^>]*class="quantity-input"[^>]*>/)?.[0] || ''
|
||||
assert.match(quantityInput, /v-model\.number="packageCount"/)
|
||||
assert.match(quantityInput, /type="number" inputmode="numeric"/)
|
||||
assert.match(quantityInput, /:adjust-position="true" :cursor-spacing="120" :auto-blur="true"/)
|
||||
assert.match(quantityInput, /@focus="activeTarget = 'quantity'" @confirm="submitReceipt"/)
|
||||
assert.match(page, /class="quantity-unit">箱/)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user