Skip to content

Conversation

@fitchmultz
Copy link

@fitchmultz fitchmultz commented Dec 14, 2025

Summary

This PR fixes 6 failing Playwright E2E tests by addressing root causes in both the frontend validation schemas and test implementations.

Issues Fixed

Email Validation Messages (4 tests)

  • Tests expected "Invalid email address" but Zod's default message was different
  • Added custom error message { message: "Invalid email address" } to email validation in:
    • login.tsx
    • signup.tsx
    • recover-password.tsx

Password Reset Tests (2 tests)

  • Tests were polling mailcatcher before the email was sent
  • Added wait for success toast "Password recovery email sent successfully" before polling

Sign Up with Existing Email (1 test)

  • Test didn't wait for first signup to complete before attempting second signup
  • Changed assertion from .click() to proper .toBeVisible()

Root Cause Fix

  • Fixed signUpNewUser utility to wait for signup completion (waitForURL("/login")) instead of immediately navigating away

Test Plan

  • All 41 Playwright tests pass locally
  • Changes are minimal and targeted to fix only the failing tests

Files Changed

  • frontend/src/routes/login.tsx
  • frontend/src/routes/signup.tsx
  • frontend/src/routes/recover-password.tsx
  • frontend/tests/reset-password.spec.ts
  • frontend/tests/sign-up.spec.ts
  • frontend/tests/utils/user.ts

- Add custom "Invalid email address" validation message to Zod schemas
  in login, signup, and recover-password routes (fixes 4 tests)
- Wait for success toast before polling mailcatcher in password reset
  tests (fixes 2 tests)
- Fix sign-up with existing email test to wait for first signup and
  use proper toBeVisible() assertion (fixes 1 test)
- Fix signUpNewUser utility to wait for signup completion before
  navigating

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
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