Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: reactiflux/mod-bot
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: reactiflux/mod-bot
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: vc-e2e-tests
Choose a head ref
  • 14 commits
  • 25 files changed
  • 2 contributors

Commits on Jul 31, 2025

  1. Update claude settings

    vcarl committed Jul 31, 2025
    Configuration menu
    Copy the full SHA
    7762e9b View commit details
    Browse the repository at this point in the history
  2. Add Playwright e2e testing setup

    - Install @playwright/test dependency
    - Create playwright.config.ts with sensible defaults
    - Add test directory structure with happy path tests:
      - Landing page functionality and navigation
      - Health check endpoint
      - Basic routing and auth flows
    - Add npm scripts for running e2e tests
    - Configure to use dev-client server for testing
    
    🤖 Generated with [Claude Code](https://claude.ai/code)
    
    Co-Authored-By: Claude <[email protected]>
    vcarl and claude committed Jul 31, 2025
    Configuration menu
    Copy the full SHA
    15cfaf1 View commit details
    Browse the repository at this point in the history
  3. Fix Playwright tests to prevent hanging on Discord OAuth redirects

    - Replace navigation tests that follow Discord OAuth redirects with href validation
    - Add route interception to capture OAuth URLs without external navigation
    - Create dedicated auth-flow.spec.ts with proper OAuth testing
    - Update health check test to handle both OK and ERROR responses
    - Remove aggressive timeouts that could cause issues
    - Use proper assertions that don't rely on external app behavior
    
    This prevents the Discord app from opening during tests and eliminates
    hanging processes while still validating the OAuth flow works correctly.
    
    🤖 Generated with [Claude Code](https://claude.ai/code)
    
    Co-Authored-By: Claude <[email protected]>
    vcarl and claude committed Jul 31, 2025
    Configuration menu
    Copy the full SHA
    e62e02d View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2025

  1. Fix gitignore

    vcarl committed Aug 1, 2025
    Configuration menu
    Copy the full SHA
    70c7d6c View commit details
    Browse the repository at this point in the history
  2. Add programmatic authentication for e2e tests

    - Create auth helper that programmatically creates test users and sessions
    - Add authenticated user flow tests that bypass Discord OAuth
    - Update auth-flow tests to focus on route protection without external redirects
    - Implement proper test cleanup to avoid database pollution
    - Test authenticated routes, logout functionality, and session management
    
    This enables comprehensive e2e testing of authenticated features without
    requiring actual Discord OAuth flow or external app interactions.
    
    🤖 Generated with [Claude Code](https://claude.ai/code)
    
    Co-Authored-By: Claude <[email protected]>
    vcarl and claude committed Aug 1, 2025
    Configuration menu
    Copy the full SHA
    f7eda49 View commit details
    Browse the repository at this point in the history
  3. Add real Discord OAuth token capture for e2e testing

    - Create interactive auth capture script that guides user through real Discord OAuth
    - Add real-auth helper to use captured tokens in tests
    - Create comprehensive authenticated flow tests using real Discord tokens
    - Add npm script 'capture-auth' to run the auth capture process
    - Include detailed README with setup and usage instructions
    - Ignore test-auth-data.json to prevent committing real tokens
    
    This enables testing authenticated features with real Discord API calls
    while maintaining security and avoiding external app conflicts.
    
    Usage:
    1. npm run capture-auth (one-time setup)
    2. FORCE_AUTH_TESTS=1 npm run test:e2e (run authenticated tests)
    
    🤖 Generated with [Claude Code](https://claude.ai/code)
    
    Co-Authored-By: Claude <[email protected]>
    vcarl and claude committed Aug 1, 2025
    Configuration menu
    Copy the full SHA
    c5d4c39 View commit details
    Browse the repository at this point in the history
  4. Fix Playwright environment variable loading

    - Add dotenv import to playwright.config.ts to load .env file
    - Set explicit cwd and env for webServer to ensure proper environment
    - Use dotenv-cli in npm scripts to explicitly load .env
    - Add environment troubleshooting to README
    - Install dotenv-cli for command line environment loading
    
    This ensures Playwright tests have access to Discord credentials
    and other environment variables from the .env file.
    
    🤖 Generated with [Claude Code](https://claude.ai/code)
    
    Co-Authored-By: Claude <[email protected]>
    vcarl and claude committed Aug 1, 2025
    Configuration menu
    Copy the full SHA
    ee0b08e View commit details
    Browse the repository at this point in the history
  5. Add graceful port fallback for server startup

    - Add port utility functions for checking availability and finding open ports
    - Update dev/prod servers to automatically fallback to next available port
    - Add blank slate home route accessible via top-left Euno icon
    - Enhance Playwright config to handle dynamic port allocation
    - Improve developer experience with clear port conflict messaging
    
    🤖 Generated with [Claude Code](https://claude.ai/code)
    
    Co-Authored-By: Claude <[email protected]>
    vcarl and claude committed Aug 1, 2025
    Configuration menu
    Copy the full SHA
    e31bd04 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    186ffcc View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    0c9154e View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2025

  1. Add working e2e session borrowing implementation

    Implements session borrowing from live Discord OAuth sessions in the database for e2e testing without requiring real OAuth setup.
    
    Key features:
    - Borrows live sessions with Discord tokens from local database
    - Creates new test session cookies from borrowed session data
    - Handles expired tokens gracefully with fallback behavior
    - 4 comprehensive e2e tests demonstrating the approach
    - Unit tests for database query logic
    - TypeScript type safety with proper type annotations
    - Cookie parsing that handles HttpOnly and other attributes
    
    Files:
    - tests/helpers/simple-session-borrowing.ts - Core working implementation
    - tests/e2e/verified-session-borrowing.spec.ts - 4 working e2e tests
    - tests/session-borrowing.test.ts - Unit tests for DB queries
    - tests/e2e/working-session-test.spec.ts - Original proof-of-concept
    - tests/e2e/simple-session-test.spec.ts - Basic test scaffold
    
    All tests pass, TypeScript types pass, and linting passes.
    
    🤖 Generated with [Claude Code](https://claude.ai/code)
    
    Co-Authored-By: Claude <[email protected]>
    vcarl and claude committed Aug 2, 2025
    Configuration menu
    Copy the full SHA
    52033b6 View commit details
    Browse the repository at this point in the history
  2. Improve auth testing infrastructure and fix cookie parsing

    Updates existing auth helpers and test infrastructure to support the new session borrowing system:
    
    Auth Helper Improvements:
    - createTestUser() now automatically uses real Discord tokens when available
    - createTestAdmin() now automatically uses real Discord tokens when available
    - Added createRealTestUser() that requires real tokens (throws if unavailable)
    - Added fallback warnings when using mock data
    - Maintains backward compatibility with existing tests
    
    Cookie Parsing Fixes:
    - Fixed cookie parsing in all e2e tests to handle proper cookie format
    - Handles cookies with multiple = signs correctly
    - Prevents "Invalid cookie format" errors
    
    Capture Auth Script Enhancements:
    - Added direct SQLite database access to avoid complex imports
    - Better error handling and module loading
    - Added test-session-borrowing npm script
    - Cleaned up unused variable declarations
    
    Documentation:
    - Updated test README with new auth helper usage patterns
    - Documents automatic real token usage vs manual requirements
    - Explains benefits of the new approach
    
    All existing tests continue to work with enhanced functionality.
    
    🤖 Generated with [Claude Code](https://claude.ai/code)
    
    Co-Authored-By: Claude <[email protected]>
    vcarl and claude committed Aug 2, 2025
    Configuration menu
    Copy the full SHA
    c677c2f View commit details
    Browse the repository at this point in the history
  3. Fix unused variables in capture-auth script

    Removes unused variable declarations that were causing linting warnings.
    
    🤖 Generated with [Claude Code](https://claude.ai/code)
    
    Co-Authored-By: Claude <[email protected]>
    vcarl and claude committed Aug 2, 2025
    Configuration menu
    Copy the full SHA
    cc060d3 View commit details
    Browse the repository at this point in the history
  4. Add enhanced session borrowing helper with advanced features

    Provides more sophisticated session borrowing capabilities beyond the simple implementation:
    
    Features:
    - Comprehensive session filtering and search options
    - Token validation with Discord API calls
    - Session age and freshness filtering
    - Mock user creation with fallback behavior
    - Captured auth data integration
    - Type-safe interfaces for all session data
    
    Interfaces:
    - LiveSessionInfo: Complete session metadata with Discord token details
    - LiveSessionOptions: Flexible filtering options for session selection
    
    Functions:
    - findActiveSessionsInDb(): Query sessions with advanced filtering
    - createTestUserWithFallback(): Multi-tier auth fallback (live -> captured -> mock)
    - validateDiscordToken(): Real Discord API validation
    - Various utility functions for session management
    
    This complements the simple-session-borrowing.ts for more complex testing scenarios.
    
    🤖 Generated with [Claude Code](https://claude.ai/code)
    
    Co-Authored-By: Claude <[email protected]>
    vcarl and claude committed Aug 2, 2025
    Configuration menu
    Copy the full SHA
    d10f730 View commit details
    Browse the repository at this point in the history
Loading