Skip to content

Conversation

@nbudin
Copy link
Contributor

@nbudin nbudin commented Jan 31, 2026

Summary

  • Fixed critical infinite loop bug that crashed browser tabs when viewing signup rounds admin page
  • Removed non-functional default automation action code
  • Added Playwright test infrastructure with configurable permissions
  • Documented Playwright testing patterns

Critical Bug Fix

The ScheduledValuePreview component had an infinite loop in the calendar rendering code (line 214). When filling empty calendar cells at the end of a month, the while loop checked currentWeek.length < 7 but pushed elements to weekPreview, causing the condition to never change. This crashed the browser tab when certain signup round date configurations triggered the calendar preview.

Changed:

// Before (infinite loop)
while (currentWeek.length < 7) {
  weekPreview.push(...);
}

// After (fixed)
while (weekPreview.length < 7) {
  weekPreview.push(...);
}

Test Infrastructure

Added comprehensive Playwright test helpers with:

  • Database setup utilities for creating test users
  • Permission management system
  • UI login flow automation
  • See playwright-tests/README.md for full documentation

Test Plan

  • Verified signup rounds admin page loads without crashing
  • Confirmed calendar preview renders correctly
  • Tested with various signup round configurations including null start dates

🤖 Generated with Claude Code

nbudin and others added 5 commits January 31, 2026 12:48
- Add Playwright as dev dependency
- Create reusable login helpers for authentication flows
- Add database setup utilities for creating test users
- Implement configurable permission system via command-line args
- Add comprehensive README with usage examples

Key features:
- setupAndLogin() - one-stop function to create user and login
- ensureTestUser() - creates users with specified permissions
- No hardcoded convention domains (must be specified per test)
- Default: creates regular users with no special permissions
- Tests can grant specific permissions as needed

Usage:
  await setupAndLogin(page, 'mycon.test', ['update_convention']);

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
- Add /test-results and /playwright-report to .gitignore
- Add comprehensive Playwright section to CLAUDE.md with:
  - Quick start guide with code examples
  - Documentation of key helpers (setupAndLogin, ensureTestUser, login)
  - Permission system explanation
  - Environment variables reference
  - Running tests commands
  - Best practices

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
The while loop on line 214 was checking currentWeek.length < 7 but pushing
elements to weekPreview. This caused an infinite loop that crashed the browser
tab when rendering signup rounds with certain date configurations.

Changed the loop condition to check weekPreview.length instead, which properly
increments as elements are added.

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
…ng or encoding

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
nbudin and others added 2 commits January 31, 2026 14:06
…ng or encoding

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@github-actions
Copy link
Contributor

Code Coverage Report: Only Changed Files listed

Package Coverage
Overall Coverage 🟢 56.5%

Minimum allowed coverage is 0%, this run produced 56.5%

@nbudin nbudin merged commit 99897cf into main Jan 31, 2026
19 checks passed
@nbudin nbudin deleted the fix-adding-rounds branch January 31, 2026 22:16
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.

2 participants