test: 补 v1.1.0 修复的回归测试
CI/CD Pipeline / Backend Build & Test (push) Canceled after 0s
CI/CD Pipeline / Admin Web Build (push) Canceled after 0s
CI/CD Pipeline / Mini Program Compile Check (push) Canceled after 0s
CI/CD Pipeline / Migration Validation (push) Canceled after 0s
CI/CD Pipeline / Test Shell Guard (Phase 23 Gate) (push) Canceled after 0s
CI/CD Pipeline / UI Contracts (source-structure gates) (push) Canceled after 0s
CI/CD Pipeline / E2E (live stack) (push) Canceled after 0s

- RealIdentityVerificationProvider: 伪造证件校验位拦截、配置缺失 fail-fast、第三方 fail-closed
- AuthService: 钉死刷新 Token Redis TTL 用 getRefreshExpirationMs(14 天)而非 access*2(4 小时)
- PhotoService: 直传落库 + 归属/存在性护栏(修复「传了白传」)
- JwtAuthFilter: 管理端 HttpOnly Cookie(dy_op_at)兜底鉴权 + 头优先于 Cookie
- miniapp profileLabels: 枚举码→中文映射不退化(serviceTypeLabel / labelOf)
This commit is contained in:
WorkBuddy
2026-09-30 14:05:48 +08:00
parent 5c97c57c76
commit 47cccc9ca5
5 changed files with 382 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
// 纯函数回归测试:枚举码 → 中文映射(修复「枚举码直渲未映射中文」)
// 运行:node ui-tests/profileLabels.test.mjs
import assert from 'node:assert/strict'
import { createRequire } from 'node:module'
const require = createRequire(import.meta.url)
const { serviceTypeLabel, labelOf } = require('../miniapp/constants/profileLabels.js')
let passed = 0
function check(name, actual, expected) {
assert.equal(actual, expected, `${name}: 期望 "${expected}",实际 "${actual}"`)
passed++
}
// ===== 红娘服务类型映射(本次修复点:matchmaker-workbench 卡片曾直渲枚举码)=====
check('recommend_partner', serviceTypeLabel('recommend_partner'), '推荐对象')
check('review_preference', serviceTypeLabel('review_preference'), '择偶指导')
check('contact_intention', serviceTypeLabel('contact_intention'), '牵线意向')
check('未知码回退原值', serviceTypeLabel('mystery_code'), 'mystery_code')
check('空串返回空', serviceTypeLabel(''), '')
check('null 返回空', serviceTypeLabel(null), '')
// ===== 通用 labelOf(既有字典,回归不退化)=====
check('labelOf education', labelOf('educationCode', 'bachelor'), '本科')
check('labelOf marital', labelOf('maritalStatus', 'never_married'), '未婚')
check('labelOf 未知码回退', labelOf('maritalStatus', 'xxx'), 'xxx')
console.log(`✅ profileLabels 回归测试全部通过(${passed} 项)`)