Repository navigation
test(agent): pin the login page contract - LoginPage - #2032
Merged
Merged
Conversation
Hold the one export of entrypoints/app/login/LoginPage.tsx against its contract (#1576): the settled no-session mount answers the welcome card with its back button and title, the email field with its label and placeholder, the magic-link submit disabled on the empty address, the separator line and the Google button with its drawn logo, and keeps the error alert away. The pending spinner branch, the effect-gated session redirect, the submit gating, the sent and error cards and both loading disables are pinned as source checks - a later suite's auth stand-in would answer its own fixed session, not this file's fixture, so the static card stays pinned only in the state every stand-in agrees on. The router and the auth client ride the sibling suites' own stand-in shapes. Closes #1576 Dmitrii Fedorov ([@dmitrii-f-t27](https://github.com/dmitrii-f-t27))
Summary by t27-beesThis PR adds a contract test for Worth a look
Read: 1 files, +127 -0, the whole diff. Head |
β Tests passed β 3873/3943
|
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
Hold the one export of
trios/agent-server/apps/agent/entrypoints/app/login/LoginPage.tsxβLoginPageβ against its contract (#1576), so the next change to that file has something to fail against.What is pinned:
lucide-arrow-left) and theWelcome to BrowserOStitle with its description, the email field with its label andyou@example.complaceholder, the magic-link submit disabled on the empty address (exactly onedisabled=""in the card), theOr continue withseparator, theContinue with Googlebutton with its drawn logo (aria-label="Google") β and the error alert stays away;isPending, the session redirect effect-gated behindsession && !isPendingtoward/home, the submit gated on a non-empty address, both loading disables measured (input and Google button), the sent card'sCheck your emailtitle andUse a different emailreset, and the destructive error alert behind{error && (β these branches live in handlers and effects a static render never presses, and a later suite's auth stand-in would answer its own fixed session, so only the state every stand-in agrees on is pinned as markup.Two stub sets ride the sibling suites' own stand-in shapes: the router (spread from the real module read through a query-qualified specifier, with the navigate hook answering a plain callback β the same block as the onboarding steps suites) and the auth client (
signIn/signUp/signOut/useSessionanswering the settled no-session state, the same shape asStepsLayoutandStepTwo), so whichever suite links last, this card renders the same.Verification
bun test entrypoints/app/login/LoginPage.test.tsβ 2 pass, 0 fail.if (isPending)βif (!isPending)) turns both tests red (0 pass, 2 fail); the copy restores clean viagit checkout.entrypoints/app/login/,entrypoints/onboarding/,entrypoints/app/admin-dashboard/): 13 pass, 0 fail across 10 files.biome cion the suite file: clean.tsgo --noEmit: 0 mentions of the suite file.Closes #1576
Dmitrii Fedorov (@dmitrii-f-t27)