You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AdminService has no unit tests: user management and fraud actions are uncovered #1086
AdminService has no unit tests: user management and fraud actions are uncovered
Labels / Complexity: testing · Medium Complexity — Medium
Problem
src/admin/ has 9 files but only 2 specs, both in test/admin/ (backup.service.spec.ts, transaction-status.dto.spec.ts) — neither covers AdminService. The service implements the highest-privilege operations: user management, fraud blocking/scans, and content administration. None of it is pinned by tests, so a regression that lets an admin action misfire ships silently; with the admin e2e gap (#112), the module is unguarded at both levels.
Why this is architecturally hard
Privilege escalation is the risk. Tests must pin that admin actions require the right role (guards) and that the service enforces its own checks — the defense-in-depth boundary.
Fraud actions are stateful. Block/scan flows mutate user and alert state; tests need controlled fixtures asserting the resulting state transitions.
Acceptance criteria
Unit tests cover user-management actions and at least one fraud action (block/scan) with role enforcement.
Tests run in CI via npm test; the PR reports coverage via npm run test:cov.
@redman7712 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
Hi Maintainer! I'm a senior developer with experience building high-quality, production-ready software. I'd love to take on this issue and deliver a clean, well-tested solution that aligns with the project's standards. Please assign it to me—I'm ready to get started and contribute effectively.
@shadrackmanfred has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
Hi Maintainer! I'm a senior developer with experience building high-quality, production-ready software. I'd love to take on this issue and deliver a clean, well-tested solution that aligns with the project's standards. Please assign it to me—I'm ready to get started and contribute effectively.
Congratulations, @shadrackmanfred! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on August 31, 2026.
🧑💻 @shadrackmanfred: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
Warning
When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
Activity
oscar24357 commentedon Aug 26, 2026
@oscar24357 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @oscar24357 to this issue.
egwujiohaifesinachiperpetual-max commentedon Aug 26, 2026
@egwujiohaifesinachiperpetual-max has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @egwujiohaifesinachiperpetual-max to this issue.
redman7712 commentedon Aug 26, 2026
@redman7712 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @redman7712 to this issue.
shadrackmanfred commentedon Aug 26, 2026
@shadrackmanfred has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @shadrackmanfred to this issue.
drips-wave commentedon Aug 26, 2026
Congratulations, @shadrackmanfred! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on August 31, 2026.
🧑💻 @shadrackmanfred: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
Warning
When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
🌊 Happy Wave 🌊
shadrackmanfred commentedon Aug 28, 2026
Resolved on branch
fix/type-safety-and-admin-tests(commit 1f932bf): added test/admin/admin.service.spec.ts with 27 unit tests covering user management, property moderation, transaction monitoring, fraud block/scan/review actions, backup delegation, and ADMIN-role guard metadata. admin.service.ts coverage: 96.7% statements / 68.1% branches.shadrackmanfred commentedon Sep 1, 2026
Addressed by #1173.