Skip to content

Add e2e test suite with fake GitHub OAuth server#2

Open
c4ffein wants to merge 1 commit intocodebaseshow:mainfrom
c4ffein:pr-base-e2e-tests
Open

Add e2e test suite with fake GitHub OAuth server#2
c4ffein wants to merge 1 commit intocodebaseshow:mainfrom
c4ffein:pr-base-e2e-tests

Conversation

@c4ffein
Copy link
Copy Markdown

@c4ffein c4ffein commented Mar 20, 2026

Hi @mvila, tbh this PR was made mainly by Claude. I want to introduce 1 or 2 feature there but these e2e tests first would ensure no regression.... So anyway, nudged/harnessed/verified to be qualitative enough, don't hesitate to tell me if anything is wrong and it will be changed :) Leaving the rest of this description to Claude

What this PR does

This adds a Playwright-based end-to-end test suite that exercises the full submit-and-review workflow without hitting real external services.

New: e2e/ directory

  • submit-and-review.spec.ts - User A submits an implementation, User B is promoted to admin and approves it. Covers OAuth sign-in, form filling, submission, admin review, and approval.
  • fake-github-server.ts - Express server mocking GitHub's OAuth flow, user profile, emails, and repository endpoints. Supports switching between test users on the fly.
  • test-helpers.ts - MongoDB Memory Server for an isolated database, seed data, and a helper HTTP server for test-time operations like granting admin rights.
  • global-setup.ts / global-teardown.ts - Spins up all services before tests, tears them down after. Includes stale-process cleanup to avoid port conflicts.
  • Fixtures - Minimal test users, repo data, and a seed project document.

Changed: backend configurability

  • github.ts - GITHUB_API_BASE_URL and GITHUB_LOGIN_URL now read from env vars with the original values as defaults. No production impact.
  • boostr.config.mjs - DATABASE_URL env var override, falling back to the existing local MongoDB URL. No production impact.
  • .gitignore - Added package-lock.json.

Test plan

  • cd e2e && npm install && npx playwright install --with-deps chromium && npm test
  • Confirm the submit-and-review flow passes
  • Confirm the app behaves normally without the env vars set

Claude

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.

1 participant