Commit Graph

2 Commits

Author SHA1 Message Date
Jeff Emmett 00a21f9610 feat: add worker unit tests for board permissions
Comprehensive test coverage for the board permissions system:
- handleGetPermission (authenticated/unauthenticated users)
- handleListPermissions (admin filtering)
- handleGrantPermission (editor assignment)
- handleRevokePermission (editor removal)
- handleUpdateBoard (protected status, global access)
- handleCreateAccessToken (security validation)
- handleListAccessTokens (admin-only access)
- handleRevokeAccessToken (token deletion)
- handleGetGlobalAdminStatus (admin checks)
- handleGetBoardInfo (board metadata)
- handleListEditors (editor listing)

Tests cover key security scenarios:
- Anonymous users get edit on new boards (permission model)
- Protected boards require authentication
- Access tokens cannot grant admin permissions
- View permission returned when database unavailable (secure default)

30 tests total, all passing.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 02:58:22 -05:00
Jeff Emmett 4f6ff1797f feat: add worker unit tests for CryptID auth handlers
- Create 25 unit tests for CryptID authentication handlers
- Add vitest.worker.config.ts for worker test environment
- Update CI workflow to run worker tests
- Test coverage for:
  - handleCheckUsername (validation, normalization)
  - handleLinkEmail (validation, database errors)
  - handleVerifyEmail (token validation)
  - handleRequestDeviceLink (validation, 404 handling)
  - handleLinkDevice (token validation)
  - handleLookup (publicKey validation)
  - handleGetDevices (auth validation)
  - handleRevokeDevice (auth and validation)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 02:46:28 -05:00