This commit is contained in:
2026-08-25 20:50:01 +08:00
parent f6d4ed6c3c
commit 6572771227
12 changed files with 341 additions and 86 deletions
+4 -3
View File
@@ -5,10 +5,11 @@ import { readFile } from 'node:fs/promises'
const read = (path) => readFile(new URL(path, import.meta.url), 'utf8')
test('remote PDA mutations use the shared online gate', async () => {
const [api, network, page] = await Promise.all([
read('../api/pda-loading.js'), read('../utils/network.js'), read('../pages/picking/picking.vue')
const [api, http, network, page] = await Promise.all([
read('../api/pda-loading.js'), read('../api/http.js'), read('../utils/network.js'), read('../pages/picking/picking.vue')
])
assert.match(api, /function request\(options\) \{[\s\S]*?requireOnline\(\)/)
assert.match(api, /const request = apiRequest/)
assert.match(http, /async function runAuthenticated\(execute\) \{[\s\S]*?requireOnline\(\)/)
assert.match(api, /uploadEvidenceFile[\s\S]*?requireOnline\('当前网络不可用,无法上传装柜照片'\)/)
assert.match(network, /uni\.onNetworkStatusChange/)
assert.match(network, /result\.networkType !== 'none'/)