Skip to content

test(users): userRepository coverage#198

Merged
greatest0fallt1me merged 10 commits intoCalloraOrg:mainfrom
JojoFlex1:test/user-repository
Mar 31, 2026
Merged

test(users): userRepository coverage#198
greatest0fallt1me merged 10 commits intoCalloraOrg:mainfrom
JojoFlex1:test/user-repository

Conversation

@JojoFlex1
Copy link
Copy Markdown
Contributor

  • Uniqueness constraints: duplicate stellar_address on create and update
  • Input validation: empty/whitespace stellarAddress and id fields
  • Whitespace trimming: stellarAddress trimmed before persistence
  • DTO shape: camelCase fields only, no snake_case column leakage
  • createdAt is a proper Date instance, not a raw string
  • list edge cases: empty table, offset beyond total, snake_case list shape
  • Fix: replaced gen_random_uuid counter with node:crypto randomUUID
  • Fix: wrap pool query to pass explicit UUID on INSERT, working around pg-mem 3.x global function registration bug
  • Security note: no PII in test data, all addresses are synthetic Stellar-format strings
    close Repositories: userRepository tests (lookup + uniqueness assumptions) #148

- Uniqueness constraints: duplicate stellar_address on create and update
- Input validation: empty/whitespace stellarAddress and id fields
- Whitespace trimming: stellarAddress trimmed before persistence
- DTO shape: camelCase fields only, no snake_case column leakage
- createdAt is a proper Date instance, not a raw string
- list edge cases: empty table, offset beyond total, snake_case list shape
- Fix: replaced gen_random_uuid counter with node:crypto randomUUID
- Fix: wrap pool query to pass explicit UUID on INSERT, working around
  pg-mem 3.x global function registration bug
- Security note: no PII in test data, all addresses are synthetic Stellar-format strings
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 29, 2026

@JojoFlex1 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@JojoFlex1
Copy link
Copy Markdown
Contributor Author

Note: src/lib/prisma.ts line 17 has a pre-existing no-require-imports lint error that predates this branch see commits 5a46be9, caa57cd. Fixing it breaks typecheck due to @prisma/client export resolution. Left out of scope tracked separately

…path

- Import PrismaClient from src/generated/prisma/client.js instead of @prisma/client
- Use double cast (unknown as PrismaClientLike) to satisfy type checker
- Pre-existing issue; fixed opportunistically to unblock CI lint check
@JojoFlex1
Copy link
Copy Markdown
Contributor Author

Test output: 24 passed, 0 failed
Note: CI failures are pre-existing test:integration and test:coverage scripts don't exist in package.json, and multiple unrelated test files fail due to missing database/env setup in CI.
Security note: No PII in test data al l addresses are synthetic Stellar-format strings.
Data integrity note: Uniqueness constraints validated at unit level via pg-mem.

@JojoFlex1
Copy link
Copy Markdown
Contributor Author

could you please merge my pr

@greatest0fallt1me greatest0fallt1me merged commit f004bb5 into CalloraOrg:main Mar 31, 2026
1 check failed
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.

Repositories: userRepository tests (lookup + uniqueness assumptions)

2 participants