fix(pda): 修复海外PDA真机作业并固定APK与热更新发布流程
This commit is contained in:
@@ -54,6 +54,44 @@ test('camera resume retains all unsigned uploads by role and clears them across
|
||||
vm.suspendReceiving()
|
||||
})
|
||||
|
||||
test('camera callbacks before and after onShow keep every unsigned photo after preparing a container', async t => {
|
||||
store.resetReceivingSession()
|
||||
const current = sessionValue({ status: 'WAIT_SIGN', preparedAt: '2026-11-06T17:24:00.124', photos: [], domesticLoadingPhotos: [] })
|
||||
const { vm, definition } = page({
|
||||
prepareReceivingContainer: async () => ({ ...current, preparedAt: '2026-11-06T17:24:00.123789' }),
|
||||
getCurrentReceiving: async () => structuredClone(current),
|
||||
uploadCurrentUnloadPhoto: async path => ({ fileId: path.split(':')[1] })
|
||||
})
|
||||
t.after(() => vm.suspendReceiving())
|
||||
const previousUni = globalThis.uni
|
||||
t.after(() => { globalThis.uni = previousUni })
|
||||
vm.refreshBoundWarehouse = async () => {}
|
||||
let refresh, upload, camera
|
||||
const bootstrap = vm.bootstrap, replacePhoto = vm.replacePhoto
|
||||
vm.bootstrap = () => { refresh = bootstrap(); return refresh }
|
||||
vm.replacePhoto = (...args) => { upload = replacePhoto(...args); return upload }
|
||||
globalThis.uni = { chooseImage: options => { camera = options; definition.onHide.call(vm) } }
|
||||
store.receiving.selected = { ...current, sourceContainerBookingId: 'BOOKING-A', allPlansReady: true, operable: true }
|
||||
await vm.prepareContainer()
|
||||
vm.bootstrapped = true
|
||||
|
||||
vm.choosePhoto(0)
|
||||
camera.success({ tempFilePaths: ['camera:plate'] })
|
||||
definition.onShow.call(vm)
|
||||
await upload
|
||||
assert.equal(vm.photoSlots[0].fileId, 'plate')
|
||||
|
||||
for (const [index, role] of [[1, 'seal'], [2, 'door']]) {
|
||||
vm.choosePhoto(index)
|
||||
definition.onShow.call(vm)
|
||||
await refresh
|
||||
camera.success({ tempFilePaths: [`camera:${role}`] })
|
||||
await upload
|
||||
}
|
||||
assert.deepEqual(vm.photoSlots.map(photo => photo?.fileId), ['plate', 'seal', 'door'])
|
||||
assert.equal(vm.photosReady, true)
|
||||
})
|
||||
|
||||
test('same current readback retains three signed previews; collapsed unversioned domestic images issue no downloads', async () => {
|
||||
store.resetReceivingSession(); const calls = []
|
||||
const download = async path => { calls.push(path); return `local:${path}` }
|
||||
|
||||
Reference in New Issue
Block a user