Skip to content

chore(tests): use supabase client in test utils - #502

Open
chiptus wants to merge 2 commits into
mainfrom
chore-36/test-utils-supabase-client
Open

chiptus wants to merge 2 commits into
mainfrom
chore-36/test-utils-supabase-client

Conversation

@chiptus

@chiptus chiptus commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Converges tests/utils/groups.ts and tests/utils/login.ts off raw fetch + hand-built ADMIN_HEADERS onto the typed admin Supabase client, extracted into a shared tests/utils/supabaseAdmin.ts that linkWizardArtist.ts now also uses instead of its own separate instance.
Error handling goes through the client's { data, error } shape, with messages that still name the email/id and operation attempted.

UPL-36

Verification

  • pnpm test (655 tests) passes; pnpm run typecheck and pnpm run lint are clean.
  • Run tests/e2e/active-group.spec.ts, tests/e2e/onboarding.spec.ts, tests/e2e/voting.spec.ts, and any other spec using signInAsAdmin/createGroupWithMember/addMemberToGroup against a local Supabase instance — sign-in, group creation, and admin-role grants still succeed exactly as before.
  • Note: this sandbox's Docker daemon can't run local Supabase end-to-end (the bundled Realtime container's schema-seed step needs an IPv6 socket the kernel here doesn't support, regardless of -x realtime exclusion), so the e2e specs above weren't run live here — the swap was verified type-by-type against src/integrations/supabase/types.ts and cross-checked against the existing linkWizardArtist.ts usage of the same client instead.

🤖 Generated with Claude Code

https://claude.ai/code/session_01S7jKDawjBQighiJvRL7LjZ


Generated by Claude Code

tests/utils/groups.ts and tests/utils/login.ts hand-built REST/Auth
requests via fetch with duplicated ADMIN_HEADERS; converge them onto
the typed admin Supabase client, extracted from linkWizardArtist.ts
into a shared tests/utils/supabaseAdmin.ts.

UPL-36

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S7jKDawjBQighiJvRL7LjZ
Self-review flagged that delegating to addMemberToGroup re-resolved
the already-known user id via a second admin API round-trip; insert
the membership row directly instead, matching the original fetch-based
behavior.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S7jKDawjBQighiJvRL7LjZ
Copilot AI lite review requested due to automatic review settings September 16, 2026 05:18
@vercel

vercel Bot commented Sep 16, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
upline Ready Ready Preview Sep 16, 2026 5:18am UTC

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No unresolved review issues were identified.

Pull request overview

Refactors E2E test utilities to use a shared typed Supabase admin client instead of raw REST requests.

Changes:

  • Added a shared admin client.
  • Migrated login and group helpers to typed Supabase operations.
  • Reused the client in link-wizard fixtures.
File summaries
File Description
tests/utils/supabaseAdmin.ts Defines the shared typed admin client.
tests/utils/login.ts Uses admin auth and database operations.
tests/utils/linkWizardArtist.ts Reuses the shared client.
tests/utils/groups.ts Uses typed group and membership operations.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

Copy link
Copy Markdown

Playwright test results

passed  65 passed

Details

stats  65 tests across 21 suites
duration  1 minute, 28 seconds
commit  19671d4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants