You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(showcase): rework auth probe and e2e for unmount-based sign-out flow
The auth demo refactor flipped its lifecycle: unauthenticated is now
the default state, <CopilotKit> only mounts after sign-in, and
sign-out unmounts the entire chat tree (instead of leaving stale
auth headers in a still-mounted chat). The old probe + e2e spec
chased a 401-error-banner surface that no longer exists in the new
demo, plus a brittle 500ms hardcoded `useEffect` flush wait.
Probe rewrite (`d5-auth.ts` + tests):
- Add `buildAuthPreFill` that clicks the SignInCard's sign-in button
before turn 1, then waits for the chat textarea to mount (proves
<CopilotKit> handshook with the runtime).
- `buildAuthAssertion` now clicks sign-out, then waits for SignInCard
to re-mount. The unmount marker IS the proof — no chat-send-and-401
dance is needed (or possible — there's no chat to send into).
- Drop the hardcoded 500ms setTimeout, the unauth-banner wait, and
the error-surface poll. None apply to the new flow.
E2E rewrite (`tests/e2e/auth.spec.ts`):
- "page loads unauthenticated with SignInCard visible"
- "signing in mounts the chat surface with AuthBanner"
- "authenticated send produces an assistant response"
- "signing out unmounts the chat tree and re-renders SignInCard"
- "signing back in re-mounts a fresh chat surface"
Fixture comment updated to reflect the new flow. The user message
("auth check turn 1") and content response are unchanged.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: showcase/harness/fixtures/d5/auth.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
{
2
-
"_comment": "D5 fixture for /demos/auth. The script signs in by default (the demo page hydrates authenticated), sends one message, then in the assertion clicks [data-testid='auth-sign-out-button'] and waits for [data-testid='auth-demo-error'] OR [data-testid='auth-demo-chat-boundary'] to surface — proves the auth gate actually rejects post-sign-out activity. Substring 'auth check turn 1' is unique.",
2
+
"_comment": "D5 fixture for /demos/auth. The demo defaults to UNAUTHENTICATED — the probe's preFill clicks the SignInCard's sign-in button to mount <CopilotKit> + chat, the runner sends 'auth check turn 1', the assertion clicks sign-out and waits for the SignInCard to re-mount (proves the entire chat tree unmounted on sign-out). Substring 'auth check turn 1' is unique across the d5-all bundle.",
0 commit comments