Skip to content

test(e2e): add voting flow spec#150

Open
chiptus wants to merge 1 commit into
mainfrom
claude/issue-111-e2e-voting-flow
Open

test(e2e): add voting flow spec#150
chiptus wants to merge 1 commit into
mainfrom
claude/issue-111-e2e-voting-flow

Conversation

@chiptus

@chiptus chiptus commented Jul 10, 2026

Copy link
Copy Markdown
Owner

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-pressed for stable selectors; the existing seeded festival/edition/sets already satisfied the spec's data preconditions, so supabase/seed.sql is unchanged.

Closes #111

Verification

  • pnpm run test:setup then pnpm run test:e2e -- voting.spec.ts — all voting scenarios pass headless.
  • Re-run the same command back-to-back — no flakiness from ambient state (each scenario targets a distinct seeded set; sign-in uses a per-worker unique email).
  • Click a vote button while signed out — the sign-in dialog appears and the button stays unselected.
  • pnpm run lint, pnpm test, and pnpm run build all 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:e2e myself 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

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
Copilot AI review requested due to automatic review settings July 10, 2026 16:02
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
upline Ready Ready Preview, Comment Jul 10, 2026 4:02pm

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ts covering 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-testid hooks (and aria-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 thread tests/e2e/voting.spec.ts
Comment on lines +15 to +17
test.describe("Voting on a set", () => {
let context: BrowserContext;
let page: Page;
Comment thread tests/e2e/voting.spec.ts
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

e2e: voting flow spec (must-go / interested / won't-go)

3 participants