fix(backend): admin 403 tests, search short-circuit, upcoming matches endpoint, tier boundary tests#1240
Merged
Olowodarey merged 1 commit intoJun 27, 2026
Conversation
…1131 - Arena1X#1120: boundary tests for predictorTierFromReputation already present (0,199,200,499,500,999,1000) - Arena1X#1121: add short-query guard in SearchService.search (<2 chars → empty response, no DB hit) + unit tests - Arena1X#1123: add RolesGuard enforcement tests to AdminController (403 for role=user, pass for role=admin on dashboard/stats, users, users/:id/ban) - Arena1X#1131: add getUpcomingMatches() to CreatorEventsService + GET :id/matches/upcoming route + unit tests
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@euniceotowo 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves four backend issues in a single clean pass.
Changes
#1121 — SearchService short-circuit on short queries
SearchService.search: queries shorter than 2 characters return an empty response without hitting any repository""and single char"a"both short-circuit (no DB call,total = 0)#1123 — AdminController rejects non-admin users with 403
describe('AdminController — RolesGuard enforcement')block inadmin.controller.spec.tsRolesGuard+Reflectorto assertcanActivatereturnsfalseforrole='user'andtrueforrole='admin'on:GET /admin/dashboard/statsGET /admin/usersPATCH /admin/users/:id/ban#1131 — GET /creator-events/:id/matches/upcoming
getUpcomingMatches(eventId)toCreatorEventsService: queries DB formatch_time > now AND result_submitted = false ORDER BY match_time ASC, throws 404 for unknown eventsGET :id/matches/upcomingroute toCreatorEventsController#1120 — predictorTierFromReputation boundary values
analytics.service.spec.ts— no code changes needed, confirmed passingTest results
Closes #1120
Closes #1121
Closes #1123
Closes #1131