优化
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import test from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { readFile } from 'node:fs/promises'
|
||||
|
||||
const read = (path) => readFile(new URL(path, import.meta.url), 'utf8')
|
||||
|
||||
test('picking task list exposes only operator-facing production information', async () => {
|
||||
const [tasks, adapter] = await Promise.all([
|
||||
read('../pages/tasks/tasks.vue'),
|
||||
read('../api/pda-loading.js')
|
||||
])
|
||||
|
||||
assert.match(tasks, /共 \$\{tasks\.length\} 个待处理任务/)
|
||||
assert.match(tasks, /v-if="task\.displayNo"/)
|
||||
assert.match(tasks, /v-if="task\.warehouseName"/)
|
||||
assert.doesNotMatch(tasks, /接口返回|当前接口|apiEnvironment|rawTaskCount|账号:|未命名订单|缺少仓库信息|服务端就绪校验|console\.info/)
|
||||
assert.doesNotMatch(adapter, /业务单号待同步/)
|
||||
})
|
||||
|
||||
test('production login contains no built-in account or password', async () => {
|
||||
const login = await read('../pages/login/login.vue')
|
||||
|
||||
assert.match(login, /form: \{ userId: '', password: '' \}/)
|
||||
assert.doesNotMatch(login, /platform_admin|ChangeMe123!/)
|
||||
})
|
||||
Reference in New Issue
Block a user