This commit is contained in:
2026-08-25 20:52:11 +08:00
parent 6572771227
commit 69f8fdfcdb
4 changed files with 40 additions and 3 deletions
+6 -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] = await Promise.all([
read('../pages/login/login.vue'), read('../api/auth.js'), read('../stores/session.js'), read('../config/runtime.js'), read('../vite.config.js')
])
for (const text of ['柏悦物流 · PDA作业端', '工号 / 用户名', '登录中']) assert.match(login, new RegExp(text))
assert.doesNotMatch(login, /DEMO_ACCOUNTS|快捷登录|作业仓库/)
@@ -39,7 +39,11 @@ test('login uses the real auth endpoint and relaunches to the modular workbench'
assert.match(session, /pda-login-account-preference/)
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 \|\| '\/api'/)
assert.doesNotMatch(runtime, /typeof\s+import\.meta/)
assert.match(vite, /API_PROXY_TARGET/)
assert.match(vite, /'\/api'[\s\S]*?target: proxyTarget[\s\S]*?changeOrigin: true/)
assert.match(vite, /removeHeader\('origin'\)/)
assert.match(login, /uni\.reLaunch\(\{ url: '\/pages\/home\/home' \}\)/)
})