This commit is contained in:
2026-08-26 17:09:07 +08:00
parent 76077369c2
commit 48d3c32293
4 changed files with 17 additions and 15 deletions
+10 -8
View File
@@ -38,7 +38,7 @@ test('login has no committed demo credentials and inbound operation implements t
read('../src/pages/login/login.vue'), read('../src/config/runtime.js'),
read('../src/pages/operation/operation.vue'), read('../src/api/inbound.js'), read('../src/api/receiving-adapter.js'), read('../src/api/overseas.js')
])
assert.match(login, /\$t\('app\.title'\)/)
assert.match(login, /柏悦物流海外版/)
assert.doesNotMatch(login, /ChangeMe|platform_admin/)
assert.match(login, /DEV_LOGIN\.username|DEV_LOGIN\.password/)
assert.match(runtime, /runtimeEnvironment\.DEV|VITE_PDA_DEV_USERNAME|VITE_PDA_DEV_PASSWORD/)
@@ -66,9 +66,9 @@ test('unimplemented warehouse operations cannot submit prototype scans', async (
read('../src/pages/operation/operation.vue'), read('../src/pages/home/home.vue'), read('../src/pages/module/module.vue')
])
assert.doesNotMatch(operation, /prototypeScan|prototypeInput/)
assert.match(operation, /operation\.unavailableTitle|operation\.unavailableDescription/)
assert.match(home, /common\.unavailable/)
assert.match(module, /module\.onlyReceiving/)
assert.match(operation, /功能暂未开放|扫码不会提交/)
assert.match(home, /暂未开放/)
assert.match(module, /当前仅开放拆柜收货,其他作业暂未开放/)
})
test('receiving phases use a compiled container summary with cabinet and aggregate facts', async () => {
@@ -78,20 +78,22 @@ test('receiving phases use a compiled container summary with cabinet and aggrega
assert.match(operation, /import ReceivingSessionSummary/)
assert.equal((operation.match(/<ReceivingSessionSummary/g) || []).length, 3)
assert.doesNotMatch(operation, /const SessionSummary|template:\s*`<view class="container-card summary-card/)
for (const fact of ['containerNo', 'inboundCodeCount', 'plannedPalletCount', 'destinationSummary', 'totalPackages', 'receivedPackages', 'pendingPackages']) assert.match(summary, new RegExp(fact))
for (const fact of ['containerNo', 'inboundCodeCount', 'plannedPalletCount', 'destinationValues', 'totalPackages', 'receivedPackages', 'pendingPackages']) assert.match(summary, new RegExp(fact))
assert.match(summary, /receiving-summary-metrics/)
assert.match(summary, /grid-template-columns:repeat\(4/)
assert.match(summary, /padding:10px 12px/)
assert.match(summary, /destination-tags\{[^}]*flex-wrap:wrap/)
assert.doesNotMatch(summary, /destinationSummary|text-overflow:ellipsis/)
})
test('Chinese English and Spanish locale resources are installed and selectable', async () => {
test('Chinese English and Spanish locale scaffolding is installed without exposing unfinished translations', 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')
])
assert.match(main, /app\.use\(i18n\)/)
for (const locale of [zh, en, es]) for (const key of ['operationPhase', 'receivingSummary', 'warehouseOperator']) assert.match(locale, new RegExp(key))
for (const locale of [zh, en, es]) assert.match(locale, /export default \{\}/)
assert.match(i18n, /SUPPORTED_LOCALES = \['zh-CN', 'en', 'es'\]/)
assert.match(profile, /setLocale|LOCALE_OPTIONS/)
assert.doesNotMatch(profile, /setLocale|LOCALE_OPTIONS|profile\.language/)
assert.match(inbound, /warehouse-profile/)
})
+2 -2
View File
@@ -53,8 +53,8 @@ test('camera replaces only one fixed slot and failed retake preserves its previo
assert.match(page, /previous\?\.fileId \? \{ \.\.\.previous, status: 'error'/)
assert.match(page, /status: 'uploading'/)
assert.match(page, /status: 'error'/)
assert.match(page, /photoStateLabel\(photo\)[\s\S]*operation\.retakeFailedKept[\s\S]*operation\.uploadFailed/)
assert.match(page, /photoSlots\[index\]\?\.fileId \? \$t\('operation\.retake'\) : \$t\('operation\.takePhoto'\)/)
assert.match(page, /photoStateLabel\(photo\)[\s\S]*已保留原图[\s\S]*上传失败/)
assert.match(page, /photoSlots\[index\]\?\.fileId \? '重拍' : '拍照'/)
assert.match(page, /previewPhoto\(index\)/)
assert.match(page, /uploadedPhotoCount\(\) \{ return this\.photoSlots\.filter\(\(item\) => item\?\.fileId\)\.length \}/)
assert.match(page, /photosReady\(\) \{ return this\.uploadedPhotoCount === 3 && !this\.photoSlots\.some/)