This commit is contained in:
2026-08-28 10:03:42 +08:00
parent 3dcebc4737
commit fdde94488d
10 changed files with 105 additions and 35 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ test('overseas profile exposes manual App update checking and the runtime versio
const profile = await read('../src/pages/profile/profile.vue')
assert.match(profile, /应用版本[\s\S]*?\{\{ appVersion \}\}/)
assert.match(profile, /@tap="checkUpdate">检查更新/)
assert.match(profile, /class="profile-row profile-row-action" @tap="checkUpdate"[\s\S]*检查更新/)
assert.match(profile, /plus\.runtime\.version/)
assert.match(profile, /checkForAppUpdate\(\{ manual: true \}\)/)
assert.match(profile, /#ifndef APP-PLUS[\s\S]*?请在 PDA App 中检查更新/)
+16
View File
@@ -0,0 +1,16 @@
import assert from 'node:assert/strict'
import { readFile } from 'node:fs/promises'
import test from 'node:test'
const stylesheet = await readFile(new URL('../src/styles/pda.scss', import.meta.url), 'utf8')
test('H5 removes the uni-app default button pseudo-element border', () => {
assert.match(
stylesheet,
/button::after,\s*uni-button::after\s*\{\s*border:\s*0\s*!important;/
)
})
test('keyboard focus remains visible after removing the default border', () => {
assert.match(stylesheet, /button:focus-visible[\s\S]*?outline:\s*3px\s+solid/)
})
+1 -1
View File
@@ -53,7 +53,7 @@ test('container UI locks and signs once across independent plans, then renders o
read('../src/api/inbound.js')
])
assert.match(operation, /item\.inboundCodeCount[\s\S]*item\.planCount[\s\S]*item\.totalPackages/)
assert.match(operation, /item\.inboundCodeCount[\s\S]*item\.totalPackages[\s\S]*item\.plannedPalletCount[\s\S]*item\.destinationCodes/)
assert.match(summary, /inboundCodeCount[\s\S]*plannedPalletCount[\s\S]*totalPackages/)
assert.doesNotMatch(operation, /v-for="[^"]*inbound[^"]*"/)
assert.match(operation, /v-if="activeInbound"[\s\S]*activeInbound\.inboundCode[\s\S]*activeInbound\.pendingPackages/)
+21 -3
View File
@@ -65,10 +65,13 @@ test('login has no committed demo credentials and inbound operation implements t
for (const role of ['LICENSE_PLATE', 'CONTAINER_SEAL', 'DOOR_OPEN']) assert.match(adapter, new RegExp(role))
for (const forbidden of ['customerId', 'planNo', 'allocationId', 'warehouseId', 'locationId']) assert.doesNotMatch(inbound, new RegExp(forbidden))
assert.match(operation, /isReceivingConflict|recoverCurrentAfterConflict/)
assert.match(operation, /isNoCurrentReceiving\(recoveryError\)[\s\S]*该柜已被其他账号选择,列表已刷新/)
assert.match(operation, /onShow\(\)[\s\S]*this\.phase === 'candidates'[\s\S]*this\.bootstrap\(\)/)
assert.match(operation, /candidateLoading[\s\S]*candidateError/)
assert.match(operation, /candidateError\.requestId[\s\S]*candidateError\.traceId/)
assert.match(operation, /@tap="loadCandidates"[^>]*>重新加载/)
assert.doesNotMatch(operation, /扫描柜号|查询柜号<\/button>|v-model="containerInput"/)
assert.match(operation, /phase === 'candidates'[^\n]*请直接点击待卸货集装箱进入详情/)
assert.match(operation, /async loadCandidates\(feedback = true\)[\s\S]*if \(this\.candidateLoading\) return[\s\S]*this\.candidateError = error/)
assert.match(operation, /async prepareContainer\(\)[\s\S]*this\.busy\) return/)
assert.match(operation, /prepareReceivingContainer[\s\S]*releaseIdempotencyKey\(key\.signature\)/)
@@ -99,10 +102,22 @@ test('receiving phases use a compiled container summary with cabinet and aggrega
assert.match(summary, /padding:10px 12px/)
assert.match(summary, /destination-tags\{[^}]*flex-wrap:wrap/)
assert.doesNotMatch(summary, /destinationSummary|text-overflow:ellipsis/)
assert.match(operation, /v-if="phase !== 'receive'" class="receiving-heading"/)
assert.match(operation, /v-if="phase !== 'candidates' && phase !== 'receive'" class="receiving-heading"/)
})
test('Chinese English and Spanish locale scaffolding is installed without exposing unfinished translations', async () => {
test('candidate containers use compact card navigation and a small refresh action', async () => {
const operation = await read('../src/pages/operation/operation.vue')
assert.match(operation, /class="container-card container-card-compact"[\s\S]*@tap="openContainer\(item\.containerNo\)"/)
assert.match(operation, /class="container-detail-link"/)
assert.doesNotMatch(operation, /<button class="primary-button"[^>]*openContainer\(item\.containerNo\)/)
assert.match(operation, /class="list-toolbar"><text>共 \{\{ candidates\.length \}\} 柜<\/text>/)
assert.match(operation, /\.list-toolbar button\{[^}]*height:28px[^}]*min-height:28px/)
assert.match(operation, /class="candidate-facts"[\s\S]*入仓码[\s\S]*计划托盘[\s\S]*目的仓/)
assert.match(operation, /class="candidate-destinations"/)
assert.doesNotMatch(operation, /item\.receivedPackages[\s\S]*item\.totalPackages[\s\S]*progress-fill/)
})
test('Chinese English and Spanish locale selection is persisted from profile without claiming unfinished copy is translated', async () => {
const [main, i18n, zh, en, es, profile, inbound] = await Promise.all([
read('../src/main.js'), read('../src/i18n/index.js'), read('../src/i18n/locales/zh-CN.js'),
read('../src/i18n/locales/en.js'), read('../src/i18n/locales/es.js'), read('../src/pages/profile/profile.vue'), read('../src/api/inbound.js')
@@ -110,6 +125,9 @@ test('Chinese English and Spanish locale scaffolding is installed without exposi
assert.match(main, /app\.use\(i18n\)/)
for (const locale of [zh, en, es]) assert.match(locale, /export default \{\}/)
assert.match(i18n, /SUPPORTED_LOCALES = \['zh-CN', 'en', 'es'\]/)
assert.doesNotMatch(profile, /setLocale|LOCALE_OPTIONS|profile\.language/)
for (const label of ['简体中文', 'English', 'Español']) assert.match(i18n, new RegExp(label))
assert.match(profile, /currentLocale, LOCALE_OPTIONS, setLocale/)
assert.match(profile, /@tap="selectLanguage"[\s\S]*切换语言/)
assert.match(profile, /uni\.showActionSheet[\s\S]*setLocale\(selected\.value\)/)
assert.match(inbound, /warehouse-profile/)
})