test(examples): runnable anonymous-sessions example + tiered tests - #7
Closed
tusharpandey13 wants to merge 1 commit into
Closed
test(examples): runnable anonymous-sessions example + tiered tests#7tusharpandey13 wants to merge 1 commit into
tusharpandey13 wants to merge 1 commit into
Conversation
…ests Add examples/with-anonymous-sessions/, a runnable example consuming the local SDK that demonstrates the full anonymous-session flow: guest session creation with metadata, Server Component and client-hook reads, login-to-link, and logout. Tiered test suite: - Unit/MSW: wire-contract and client-hook coverage. - Browser (Playwright): the session-fixation strip end-to-end and the logout and error-banner UI run without credentials; the live login-to-link callback runs against a tenant test user. - Offline mock tier (pnpm test:e2e:offline): 17 deterministic tests covering the full lifecycle, error-code mappings, renewal, and set-once retention through the real SDK against a mocked Auth0 network hop, no tenant required. COVERAGE.md documents the tier-by-tier matrix and disclosed gaps. The mock, its scenario-control route, and the gated seam are marked test-only with a production checklist in the README. No real secrets; synthetic tokens only. Not wired into CI. Depends on the anonymous-sessions SDK implementation (stacked base). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Owner
Author
|
Superseded by auth0#2814 (example, stacked on auth0#2813). Closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked PR (2/2): example + tests. Adds
examples/with-anonymous-sessions/, a runnable example consuming the local SDK that demonstrates the full anonymous-session flow. Stacked on top of the SDK implementation PR (auth0#2797); review and merge that one first.What it demonstrates
createAnonymousSession()behind aPOST /api/anon/createroute.useAnonymousSession()) side by side.anonymousSessionLinkedas a?linked=truebanner).Tests
pnpm test:e2e).pnpm test:e2e:offline): 17 deterministic tests covering the full lifecycle (create, read, logout, error-code mappings, renewal, set-once retention) through the real SDK against a mocked Auth0 network hop. No tenant required. It does not prove the real/anonymous/tokenwire contract; the live tier does.COVERAGE.mddocuments the tier-by-tier matrix and disclosed gaps.Notes
customFetchseam are marked test-only, with a production checklist in the README and a warning in.env.example.