Files
Jyotisha/frontend/tests/rectification-lazy-loading.test.ts
T
jesse-ux 3dd48c0dc3
Independent Staging Quality Gate / validate (push) Failing after 11m16s
Independent Staging Quality Gate / publish (push) Skipped
fix(test): follow the home split in source contracts and expose element colors
Gate 2888 failed ten frontend contracts after the onboarding shell and bootstrap moved out of page.tsx, and the western element colors were missing from @theme. The scans now follow the new files and still require the home page to mount them.
2026-09-25 03:32:36 +08:00

19 lines
923 B
TypeScript

import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import test from "node:test";
const page = readFileSync(new URL("../src/app/(app)/page.tsx", import.meta.url), "utf8");
const shell = readFileSync(new URL("../src/components/home-onboarding-shell.tsx", import.meta.url), "utf8");
test("loads birth-time rectification only when its onboarding stage is reached", () => {
// 原值: dynamic() 写在 page.tsx。
// 新值: dynamic() 在引导屏组件,page.tsx 仍挂载该组件。
// 原因: 首页拆分搬走了引导屏,懒加载本身没变。
assert.match(page, /<HomeOnboardingShell/);
assert.match(shell, /import dynamic from "next\/dynamic"/);
assert.match(shell, /const BirthTimeRectification = dynamic\(/);
assert.match(shell, /import\("@\/components\/birth-time-rectification"\)/);
assert.match(shell, /ssr: false/);
assert.match(shell, /role="status"/);
});