Skip to content

Conversation

@aabrius
Copy link
Contributor

@aabrius aabrius commented Dec 7, 2025

Summary

  • Adds test factories for User and Account entities
  • Implements auth helpers for JWT generation in tests
  • Creates database helpers for test data management
  • Provides mock utilities for CLS, Config, and repositories
  • Adds 78 unit tests for all testing utilities

Test plan

  • Run npm test -- --testPathPattern="user.factory|account.factory|auth.helper|database.helper" to verify all tests pass
  • Use factories in integration tests

🤖 Generated with Claude Code

aabrius and others added 2 commits December 6, 2025 22:20
- Add user and account test factories for creating test entities
- Add database helper for test DB setup/teardown and table clearing
- Add auth helper for JWT token creation in tests
- Add test-app helper for creating test NestJS applications
- Add users E2E test example demonstrating factory usage

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Add user.factory.spec.ts with 24 tests covering:
  - createTestUser with defaults and custom options
  - createTestUserWithProvider
  - createTestSuperAdmin
  - createTestInvitedUser
- Add account.factory.spec.ts with 13 tests covering:
  - createTestAccount with defaults and options
  - createTestAccounts bulk creation
- Add auth.helper.spec.ts with 23 tests covering:
  - createTestJwt with claims
  - createAuthHeader
  - createUserAuthHeader
  - createAdminJwt, createSuperAdminJwt
  - decodeTestJwt, getTestJwtSecret
- Add database.helper.spec.ts with 18 tests covering:
  - createTestDataSource configuration
  - setupTestDatabase, teardownTestDatabase
  - clearTables with transaction handling
  - clearAllTables, resetDatabase
- Add Jest moduleNameMapper for src/* path resolution

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

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Dec 7, 2025

Warning

Rate limit exceeded

@aabrius has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 27 minutes and 51 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 793cb77 and 87de3bc.

📒 Files selected for processing (14)
  • apps/backend/package.json (1 hunks)
  • apps/backend/src/test/factories/account.factory.spec.ts (1 hunks)
  • apps/backend/src/test/factories/account.factory.ts (1 hunks)
  • apps/backend/src/test/factories/index.ts (1 hunks)
  • apps/backend/src/test/factories/user.factory.spec.ts (1 hunks)
  • apps/backend/src/test/factories/user.factory.ts (1 hunks)
  • apps/backend/src/test/helpers/auth.helper.spec.ts (1 hunks)
  • apps/backend/src/test/helpers/auth.helper.ts (1 hunks)
  • apps/backend/src/test/helpers/database.helper.spec.ts (1 hunks)
  • apps/backend/src/test/helpers/database.helper.ts (1 hunks)
  • apps/backend/src/test/helpers/index.ts (1 hunks)
  • apps/backend/src/test/helpers/test-app.helper.ts (1 hunks)
  • apps/backend/src/test/index.ts (1 hunks)
  • apps/backend/test/users.e2e-spec.ts (1 hunks)
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/testing-infrastructure

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants