Commit Graph

246 Commits

Author SHA1 Message Date
david 2658dc07cb chore: remove .env.production from repository and add to .gitignore
Pull Request / unit-tests (pull_request) Successful in 59s
Pull Request / e2e-tests (pull_request) Successful in 3m6s
Pull Request / analyze-bump-type (pull_request) Successful in 11s
2026-04-26 16:44:48 -07:00
david 6cfd5d325a chore: add new route pages and environment configuration 2026-04-26 16:44:48 -07:00
david 9589bb8718 test: update test files and documentation 2026-04-26 16:44:48 -07:00
david d436b1f66e fix: update authentication and navigation components 2026-04-26 16:44:48 -07:00
david d69bd7a0ba fix: update Prisma client configuration and cleanup script 2026-04-26 16:44:48 -07:00
david 8664d330bc ci: add E2E test job to PR workflow and update test scripts 2026-04-26 16:44:48 -07:00
david 2b38fbb0f2 test: update Cucumber step definitions for better error handling and debugging 2026-04-26 16:44:48 -07:00
david 2ae1ec6a58 test: update Cucumber configuration and support files 2026-04-26 16:44:48 -07:00
david 1d6e15c0ab fix: update registration redirect and wordmark navigation
- Simplify registration redirect after session refresh
- Update wordmark to use dynamic href based on session/role
- Add anchor tag for wordmark to avoid Next.js Link issues
2026-04-26 16:44:48 -07:00
david 9fbdc5e51f fix: add browser relaunch logic to Cucumber hooks
- Add error handling for browser context creation
- Auto-relaunch browser if context creation fails
- Add better error logging
2026-04-26 16:44:48 -07:00
david c18cf29452 fix: add database safety check to Cucumber hooks
- Prevents tests from running against production database
- Uses same logic as Playwright global setup
- Ensures test data isolation
2026-04-26 16:44:48 -07:00
david 2546de0cec fix: update Match interface in entry page to use correct player property names 2026-04-26 16:44:48 -07:00
david a06cda96f2 fix: update AdminMatchesPage to use correct player property names (player1P1, player1P2, etc.) 2026-04-26 16:44:48 -07:00
david 62ac6d1b79 feat: implement variable team matchups with partner rotation
- Add manual team entry for permanent teams in Matchups tab
- Rename 'Teams' tab to 'Matchups' for clarity
- Implement partner rotation strategies (minimize_repeat, maximize_even, elo_based)
- Track partnerships across rounds to minimize repeat pairings
- Fix unit tests for team configuration and ELO calculations
- Add E2E test for 9+ participant tournaments with variable matchups

Key changes:
- TeamsSection.tsx: Added router.refresh(), manual team entry, and matchup display
- schedule-generator.ts: Enhanced generateVariableRoundRobin to track partnerships
- team-generator.ts: Fixed partnership frequency tracking across rounds
- API routes: Updated to support variable team durability with rotation strategies
2026-04-26 16:44:48 -07:00
david eeb0f7970a refactor(tests): update remaining test files for ephemeral team model 2026-04-26 16:44:48 -07:00
david 9137fabc2b refactor(tests): update test files to use new player field names 2026-04-26 16:44:48 -07:00
david 52da77d57b refactor(ui): update components to use new player field names 2026-04-26 16:44:48 -07:00
david c00f26919b refactor(api): update all API routes to use new player field names 2026-04-26 16:44:48 -07:00
david a1329f077f refactor(lib): update rating utilities to use new player field names 2026-04-26 16:44:48 -07:00
david 118b6ea840 refactor(lib): update schedule and team generators to use player pairings 2026-04-26 16:44:47 -07:00
david 420a9ff645 refactor(schema): update Match model to use player fields instead of team fields 2026-04-26 16:44:47 -07:00
david aff0ed70e4 refactor(db): remove Team model and add player fields to BracketMatchup 2026-04-26 16:44:47 -07:00
david 903654466b chore: add .env.dev to gitignore 2026-04-26 16:44:47 -07:00
david ade3b82e3c fix: support partial updates in tournament PUT endpoint
- Change PUT endpoint to only include fields present in the request
- Add support for team configuration fields (teamDurability, partnerRotation, allowByes)
- Fix contradictory test that expected resetting allowTies when not provided
- When a field is not in the request, it is preserved (not modified)

Fixes issue where Save Configuration button would fail with
'Tournament name is required' error.
2026-04-26 16:44:47 -07:00
david 7d33947619 chore: add .env.development to gitignore 2026-04-26 16:44:47 -07:00
david 1d830ee8a3 feat: add tournamentType field to Event model
Add tournamentType field with default value 'individual':
- Supports 'individual' and 'team' tournament types
- Creates migration for database schema update
2026-04-26 16:44:47 -07:00
david e086d7398a feat: add tournament type and team support to tournament APIs
Update tournament APIs to support:
- tournamentType field (individual/team)
- Team creation for team tournaments
- Even number validation for team tournaments
- Automatic pairing of consecutive players into teams
2026-04-26 16:44:47 -07:00
david 729993913a fix: make player search case-insensitive
Add 'mode: insensitive' to Prisma query for player search:
- Allows searching by partial name regardless of case
- Improves user experience when searching for players
2026-04-26 16:44:47 -07:00
david 5763534e26 fix: check response.ok before parsing JSON in fetch calls
Fix JSON parsing errors when server returns non-JSON responses:
- Check response.ok before calling response.json()
- Add fallback error messages using status text
- Apply fix to all fetch calls across 12 components

This prevents 'JSON.parse: unexpected character' errors when
server returns HTML error pages or other non-JSON responses.
2026-04-26 16:44:47 -07:00
david ec798fc29d test: add unit tests for team generation algorithms
Add comprehensive tests for team generation:
- Test random pairing strategy
- Test ELO-based pairing strategy
- Test even matches strategy
- Test minimize repeat partnerships
- Test bye player handling
- Test team balance calculation
- Test partnership frequency tracking

All 19 tests pass.

Refs #22
2026-04-26 16:44:47 -07:00
david 1532c10223 feat: integrate TeamsSection component into tournament detail page
Update tournament detail page to use new TeamsSection component:
- Import TeamsSection component
- Replace static teams display with interactive configuration
- Pass tournament ID, teams, and participants to component

Refs #22
2026-04-26 16:44:47 -07:00
david 0ee295e9b1 feat: add TeamsSection component for team configuration UI
Add interactive team configuration panel:
- Team durability selection (permanent, variable, per_round)
- Partner rotation strategy selection
- Allow byes configuration
- Generate Teams button with participant count
- Delete All Teams functionality
- Available participants display with ELO ratings

Refs #22
2026-04-26 16:44:47 -07:00
david 912a1cd268 feat: add team generation API endpoints
Add API endpoints for team management:
- POST /api/tournaments/[id]/teams/generate: Generate teams based on configuration
- DELETE /api/tournaments/[id]/teams: Delete all teams
- GET /api/tournaments/[id]/teams: Fetch teams and configuration

Supports multiple generation strategies:
- Random pairing
- ELO-based pairing
- Even matches
- Minimize repeat partnerships

Refs #22
2026-04-26 16:44:47 -07:00
david c141fc6dd7 feat: add team generator library with multiple strategies
Implement team generation algorithms for tournament partnerships:
- Random pairing (Fisher-Yates shuffle)
- ELO-based pairing (strongest + weakest)
- Even matches (balance competitive levels)
- Minimize repeat partnerships
- Support for byes with odd participant counts
- Team balance calculation utilities

Refs #22
2026-04-26 16:44:47 -07:00
david 3beaa52335 feat: add team configuration fields to Event model
Add fields for team durability, partner rotation, and configuration:
- teamDurability: permanent, variable, or per_round
- partnerRotation: none, minimize_repeat, maximize_even, elo_based
- allowByes: handle odd participant counts
- teamConfiguration: JSON for additional options
- maxRosterChanges: limit roster changes per player
- requireAdminVerify: for match score verification

Refs #22
2026-04-26 16:44:47 -07:00
david 6547557ea4 fix: use bun.lock instead of bun.lockb in Dockerfile
Bun v1.2+ switched from binary lockfile (bun.lockb) to text-based
bun.lock format. Update the Dockerfile COPY to match.
2026-04-26 16:44:47 -07:00
david 814dff2280 test: add acceptance tests for schedule tab
Playwright tests covering: schedule link visibility, empty state,
schedule generation, round/matchup display, and API response format.
Closes #7.
2026-04-26 16:44:47 -07:00
david 54f89c4bec feat: convert tournament tabs to functional navigation links
Replace non-functional tab buttons with Link components for Schedule
and Results tabs. Disable unimplemented tabs (Participants, Teams,
Analytics) as styled spans with cursor-not-allowed.
2026-04-26 16:44:47 -07:00
david 0b792cc911 feat: add tournament schedule page with generator component
Schedule page displays round-robin rounds with matchups, team names,
status badges, and links to result entry. Generator component provides
generate/delete buttons with success/error feedback.
2026-04-26 16:44:47 -07:00
david df4d6fff7c feat: add schedule API endpoints
GET returns rounds with matchups for a tournament.
POST generates a round-robin schedule from registered teams.
DELETE removes all rounds and matchups.

All endpoints enforce tournament admin permissions via canManageTournament.
2026-04-26 16:44:47 -07:00
david 3e98c59d85 feat: add round-robin schedule generator
Implement circle-method algorithm for generating round-robin tournament
schedules. Handles both even and odd team counts with bye rounds.

Includes unit tests for algorithm correctness, input validation, and
expected round/matchup calculations.
2026-04-26 16:44:47 -07:00
Gitea Actions 75358bf20d chore: bump version to v0.1.6 v0.1.6 2026-04-26 04:27:54 +00:00
david 5dc24db277 fix: update Cucumber config and hooks to properly load test infrastructure
Pull Request / unit-tests (pull_request) Successful in 59s
Pull Request / analyze-bump-type (pull_request) Successful in 10s
Release / release (push) Failing after 13s
Build CI Images / build-ci-base (push) Failing after 21s
- Add support files to require config for proper hook loading
- Remove database cleanup from hooks (browser-only testing)
- Fix World type issues in hooks
- Cucumber tests now run successfully
2026-04-26 04:25:56 +00:00
david a77870b894 feat: add feature summary documentation
- Add FEATURE_SUMMARY.md with coverage overview
- Fix TypeScript error in World class
- Document all feature files and scenarios
2026-04-26 04:25:56 +00:00
david 8bf34640e6 docs: update README with feature files and issue tracking 2026-04-26 04:25:56 +00:00
david a0909c82a0 feat: add tournament schedule feature test (issue #7)
- Add tournament-schedule.feature with 4 scenarios
- Add step definitions for tournament schedule navigation
- Tests viewing schedule, generating round-robin, bye rounds, and matchup navigation
- Note: Some @wip scenarios require data setup (tournament creation, team addition)
2026-04-26 04:25:56 +00:00
david 4e2fcf9d28 feat: add player schedule feature test (issue #9)
- Add player-schedule.feature with 3 scenarios
- Add step definitions for schedule navigation
- Tests empty schedule, upcoming matches, and match details navigation
- Note: Some @wip scenarios require data setup (tournament, participants)
2026-04-26 04:25:56 +00:00
david d91da9b0be feat: add password reset feature test (issue #10)
- Add password-reset.feature with 4 scenarios
- Add step definition for password reset page assertion
- Tests access page, valid email request, invalid email, and empty field
2026-04-26 04:25:56 +00:00
david b4dd40da27 feat: add wordmark navigation feature test (issue #24)
- Add wordmark-navigation.feature with 3 scenarios
- Add step definitions for clicking wordmark and page assertions
- Test unauthenticated, player, and admin navigation paths
2026-04-26 04:25:56 +00:00
david c3090236dd docs: add README for Cucumber test framework 2026-04-26 04:25:56 +00:00