Skip to content

fix: mock email/password login in E2E tests#413

Open
maxachis wants to merge 2 commits intodevfrom
fix/e2e-test-timeouts
Open

fix: mock email/password login in E2E tests#413
maxachis wants to merge 2 commits intodevfrom
fix/e2e-test-timeouts

Conversation

@maxachis
Copy link
Copy Markdown
Contributor

Summary

  • Adds an MSW handler for POST /auth/login that returns mock JWT tokens for valid credentials and 401 for invalid ones
  • Exports AUTH_BASE_URL from e2e/fixtures/constants.js for the new handler
  • Fixes E2E Test Timeouts #411

This eliminates the dependency on real API credentials and external API availability for auth-dependent E2E tests, addressing two failure modes:

  1. Fork PRs: GitHub Actions doesn't expose secrets to fork PRs, causing all 22+ auth-dependent tests to fail
  2. Flaky timeouts: Real signInWithPassword API calls sometimes exceed the 30s timeout

Test plan

  • npx playwright test e2e/auth/sign-in.spec.js — all 5 tests pass
  • npx playwright test e2e/data-request/create.spec.js e2e/data-source/create.spec.js — 8/9 pass (1 pre-existing flaky failure from real POST /data-requests API, not auth-related)
  • Full suite shows no regressions from these changes

🤖 Generated with Claude Code

Add MSW handler for POST /auth/login so auth-dependent E2E tests no
longer hit the real API. This fixes two issues: fork PRs failing because
GitHub Actions doesn't expose secrets, and flaky timeouts from slow
external API responses.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@maxachis
Copy link
Copy Markdown
Contributor Author

@joshuagraber Two things!

  1. Do you think adding mocks to bypass this is a fine idea?
  2. The E2E tests were previously failing. I think we need a separate issue for that.

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