test(home): follow the profile hook's return through the signOut marker

The mount-once bootstrap effect keeps its literal `}, []);` dependency array:
two existing contract tests use that exact text as a slicing landmark, so the
effect stays as it was and its existing exhaustive-deps warning simply names two
more stable setters. Only the signOut slice marker in
chat-navigation-a11y-contract moves, with the three-column note; the assertion's
subject is untouched.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JUei7K13cYxLHE3Axe4A45
This commit is contained in:
Jesse_Chen
2026-09-16 02:02:22 +00:00
co-authored by Claude Opus 5
parent ae4573897a
commit e6c6839742
2 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -1098,7 +1098,7 @@ export default function Home() {
window.clearTimeout(bootstrapTimeout);
controller.abort();
};
}, [setProfile, setProfileDraft]);
}, []);
useEffect(() => {
if (!hydrated || uiPreview.current) return;
@@ -76,7 +76,12 @@ test("auth redirects stay hard document loads so stale session state cannot surv
assert.doesNotMatch(pageSource, /router\.replace\("\/login"\)/);
// And: the login redirect after sign-out drops the whole React tree with the session.
const signOut = sourceBetween(pageSource, "async function signOut()", "return {\n refreshAccount,");
// 原值: sourceBetween(..., "async function signOut()", "return {\n refreshAccount,")
// 新值: 同一起点,终点改成 "return {\n profile,"
// 原因: 状态下沉第二批把六个 profile 状态搬进 use-profile-onboarding.tshook 的
// return 现在以 profile 开头,refreshAccount 不再是第一个字段。切的还是
// signOut 函数体,断言主语(退出后硬跳 /login)一字未改。
const signOut = sourceBetween(pageSource, "async function signOut()", "return {\n profile,");
assert.match(signOut, /await selfHostedOtpActions\.signOut\(\);\n\s*window\.location\.assign\("\/login"\)/);
// And: the billing pane keeps the same 401 precedent without a dedicated membership page.