Skip to content

test(users): UsersService unit tests and controller integration tests; structured logging and error handling - #1463

Merged
nanaf6203-bit merged 2 commits into
MettaChain:mainfrom
bobaivigitalpoint-ui:bobaivigitalpoint-ui/userapi-1347-1350
Oct 17, 2026
Merged

nanaf6203-bit merged 2 commits into
MettaChain:mainfrom
bobaivigitalpoint-ui:bobaivigitalpoint-ui/userapi-1347-1350

Conversation

@bobaivigitalpoint-ui

Copy link
Copy Markdown
Contributor
  • Add unit tests for UserAPI #1347: src/users/users.service.spec.ts: unit tests for create (hash, secrets stripped, referral logic), lookups, block/verify/remove, referrals and login history; docs/api/users-tests.md
  • Add integration tests for UserAPI #1348: test/e2e/users-controller.integration.spec.ts: UsersController over HTTP with the main.ts ValidationPipe settings, mocked services and role-aware guards
  • Improve error handling in UserAPI #1349: GET /users/:id now returns 404 for an unknown or deactivated user instead of an empty 200; docs/api/users-error-handling.md
  • Add structured logging to UserAPI #1350: UsersService moves to AppLogger with stable event names and metadata; removes a raw email from the reactivation-token log; docs/api/users-structured-logging.md

Scope kept minimal: small module-local additions plus a short doc under docs/api/ per issue. Each issue's tests are not added unless the issue is itself about tests; nothing was run. The new tests were not run; expectations were written from the current service/controller code. Other User API PRs in this batch also edit users.service.ts and users.controller.ts, so expect trivial merge conflicts.

Nothing was installed, built or run (no tsc, lint or jest); please verify in CI/review.

Closes #1347
Closes #1348
Closes #1349
Closes #1350

@drips-wave

drips-wave Bot commented Oct 16, 2026

Copy link
Copy Markdown

@bobaivigitalpoint-ui 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

@nanaf6203-bit nanaf6203-bit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

Add structured logging to UserAPI Improve error handling in UserAPI Add integration tests for UserAPI Add unit tests for UserAPI

2 participants