test(qa): e2e 装配修正 + 集成/门禁测试与工具链重构

- e2e:修死选择器与蜜罐误命中、补断言、GA4/security-headers 用例诚实标注
  skip 边界;新增 assert-helpers/fixtures/hydrated/primary-nav/touch-targets
  等复用桩。
- 集成层:config/test/jest.integration.config.js + tests-integration/ 真库
  一次性 SQLite 用例,teardown 守卫开发库指纹。
- 门禁工具链:jest.setup 归位到根、scripts/accessibility 全站 axe 节点计数、
  check-brand-text-token/check-motion-constraints 机械守卫、stryker/lighthouse
  配置收敛。
This commit is contained in:
2026-09-28 10:48:08 +08:00
parent a366bd1400
commit 6bb7c557ee
142 changed files with 6597 additions and 2653 deletions
+9 -2
View File
@@ -95,17 +95,24 @@ report_and_exit() {
# ── 模式 1: 扫描目录 ──
if [ -n "$SCAN_DIR" ]; then
if [ ! -d "$SCAN_DIR" ]; then
[ "$QUIET" -eq 0 ] && echo "⚠ PR 目录不存在: ${SCAN_DIR}(跳过)" >&2
exit 0
echo "✘ PR 目录不存在: ${SCAN_DIR} —— 门禁根本没跑。退出 2 表示脚本自身/入参故障,不等于通过" >&2
exit 2
fi
scanned=0
while IFS= read -r f; do
[ -f "$f" ] || continue
scanned=$((scanned + 1))
body=$(read_pr_body "$f")
unchecked=$(printf '%s\n' "$body" | grep -c '^- \[ \]' || true)
if [ "$unchecked" -gt 0 ]; then
violations+=("$(basename "$f"): 存在 ${unchecked} 个未勾选子项——所有 checklist 子项须勾选后才可提交 PR")
fi
done < <(find "$SCAN_DIR" -name '*.md' -type f | sort)
if [ "$scanned" -eq 0 ]; then
echo "✘ ${SCAN_DIR} 内没有任何 *.md —— 0 个文件被检查不等于 0 个违规。退出 2" >&2
exit 2
fi
[ "$QUIET" -eq 0 ] && echo "(已扫描 ${scanned} 个 PR 描述文件)"
report_and_exit "PR 描述文件门禁通过:所有文件子项均已勾选" "PR 描述文件门禁未通过"
fi