test(e2e): add voting flow spec#150
Open
chiptus wants to merge 1 commit into
Open
Conversation
Adds tests/e2e/voting.spec.ts covering casting, persisting, changing, and removing votes on a set plus the unauthenticated sign-in prompt. TestHelpers.signIn now drives the app's real magic-link + OTP flow via the local Supabase Mailpit inbox (the UI only supports passwordless auth), and vote buttons gained data-testid/aria-pressed for stable selectors. The existing seed festival/edition/sets already satisfy the spec's data preconditions, so supabase/seed.sql is unchanged. Closes #111 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CKMx3D6cDTnUEYacpy9Mn6
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Adds a Playwright e2e spec for the set voting flow (Must Go / Interested / Won’t Go), and updates the app + test helpers to support stable selectors and real passwordless auth (magic-link/OTP) via the local Supabase Mailpit inbox.
Changes:
- Introduces
tests/e2e/voting.spec.tscovering cast/persist/change/remove voting behavior and an unauthenticated prompt case. - Updates
TestHelpers.signIn()to drive the real OTP flow end-to-end by polling Mailpit, and adds per-worker unique test emails. - Adds
data-testidhooks (andaria-pressed) for vote buttons/counts and key header controls used by e2e selectors.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/utils/test-helpers.ts | Switches sign-in helper to OTP + Mailpit polling and adds unique-email generation. |
| tests/README.md | Documents new env vars and the OTP-based auth flow in e2e tests; updates planned/covered test list. |
| tests/e2e/voting.spec.ts | New end-to-end voting flow spec. |
| tests/config/test-env.ts | Replaces password-based test creds with email-base/domain + Mailpit URL configuration. |
| src/pages/EditionView/tabs/ArtistsTab/SetCard/SetVotingButtons.tsx | Adds data-testid and aria-pressed to vote buttons (and test hooks for counts). |
| src/components/layout/AppHeader/UserMenu.tsx | Adds data-testid for a stable authenticated-menu trigger selector. |
| src/components/layout/AppHeader/UserActions.tsx | Adds data-testid for a stable sign-in button selector. |
Comment on lines
+15
to
+17
| test.describe("Voting on a set", () => { | ||
| let context: BrowserContext; | ||
| let page: Page; |
Comment on lines
+19
to
+23
| test.beforeAll(async ({ browser }) => { | ||
| context = await browser.newContext(); | ||
| page = await context.newPage(); | ||
| await new TestHelpers(page).signIn(); | ||
| }); |
Comment on lines
+123
to
+127
| <span data-testid={`vote-count-${voteType}`}> | ||
| {layout === "horizontal" | ||
| ? voteCount | ||
| : `${config.label} (${voteCount})`} | ||
| </span> |
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.
Adds a Playwright spec covering the must-go/interested/won't-go voting flow (cast, persist, change, remove, unauth prompt), driving the app's real magic-link/OTP sign-in via the local Supabase Mailpit inbox.
Vote buttons gained
data-testid/aria-pressedfor stable selectors; the existing seeded festival/edition/sets already satisfied the spec's data preconditions, sosupabase/seed.sqlis unchanged.Closes #111
Verification
pnpm run test:setupthenpnpm run test:e2e -- voting.spec.ts— all voting scenarios pass headless.pnpm run lint,pnpm test, andpnpm run buildall pass.Note: this sandbox's Docker daemon cannot pull the Supabase images (registry CDN returns 403 Forbidden on every layer), so I could not execute
pnpm run test:setup/test:e2emyself here. Verified instead via lint/typecheck/unit tests/build plus careful manual tracing of the real auth and vote-button DOM/selectors — flagging this for the reviewer to run the e2e suite before merging.Generated by Claude Code