This commit is contained in:
2026-08-26 20:50:58 +08:00
parent 258f5414d1
commit 88b52cff40
14 changed files with 488 additions and 90 deletions
+10 -2
View File
@@ -23,8 +23,8 @@ test('application uses the Vue 3 uni-app entry and no unused Android permissions
})
test('login uses the real auth endpoint and relaunches to the modular workbench', async () => {
const [login, auth, session, runtime] = await Promise.all([
read('../pages/login/login.vue'), read('../api/auth.js'), read('../stores/session.js'), read('../config/runtime.js')
const [login, auth, session, runtime, vite, manifest] = await Promise.all([
read('../pages/login/login.vue'), read('../api/auth.js'), read('../stores/session.js'), read('../config/runtime.js'), read('../vite.config.js'), read('../manifest.json')
])
for (const text of ['柏悦物流 · PDA作业端', '工号 / 用户名', '登录中']) assert.match(login, new RegExp(text))
assert.doesNotMatch(login, /DEMO_ACCOUNTS|快捷登录|作业仓库/)
@@ -34,7 +34,15 @@ test('login uses the real auth endpoint and relaunches to the modular workbench'
assert.match(session, /pda-auth-session/)
assert.match(session, /claims\.app_code !== 'PLATFORM'/)
assert.match(runtime, /import\.meta\.env\.VITE_API_BASE_URL/)
assert.match(runtime, /#ifdef H5[\s\S]*?VITE_H5_API_BASE_URL \|\| '\/gateway-api'/)
assert.doesNotMatch(runtime, /typeof\s+import\.meta/)
assert.match(vite, /API_PROXY_TARGET/)
assert.match(vite, /process\.env\.UNI_INPUT_DIR \|\| process\.cwd\(\)/)
assert.match(vite, /'\/gateway-api'[\s\S]*?target: proxyTarget[\s\S]*?changeOrigin: true[\s\S]*?replace\(\/\^\\\/gateway-api\/[\s\S]*?'\/api'/)
assert.match(vite, /removeHeader\('origin'\)/)
assert.match(vite, /removeHeader\('referer'\)/)
assert.match(vite, /proxy\.on\('error'/)
assert.doesNotMatch(manifest, /"proxy"\s*:|pathRewrite|disableHostCheck/)
assert.match(login, /uni\.reLaunch\(\{ url: '\/pages\/home\/home' \}\)/)
})