Repository navigation
test(backend): cover PaginationHelper, StatsController and GistsController; remove stray gists e2e spec - #1678
Merged
BigBen-7 merged 1 commit intoNov 19, 2026
Conversation
…oller routes; drop stray gists e2e spec (PinSpace-Org#1602 PinSpace-Org#1603 PinSpace-Org#1604 PinSpace-Org#1605)
|
@tolulopedd26 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! 🚀 |
Closed
2 tasks
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.
What changed
Backend/src/common/utils/pagination.helper.spec.ts(new):encodeCursor/decodeCursorround trip, empty, garbage, non-date, impossible-date, non-string and different-date-format inputs, plusbuildResponsefull/partial/empty pages ([Backend] Add tests for PaginationHelper (8% coverage) #1604).Backend/src/stats/stats.controller.spec.ts(new): all four routes delegate to the matchingStatsServicemethod with the query parsed by aValidationPipeconfigured like the app's (real DTOs), plus four validation failures ([Backend] Add tests for StatsController (0% coverage) #1603).Backend/src/gists/gists.controller.spec.ts: add success and failure cases forcreate,findNearby,countNearby,findOne,findContent(including the non-UUID pipe),reportandgetModerator, with the 404 mapping asserted viaNotFoundException([Backend] Cover the uncovered routes of GistsController (69% lines) #1605).Backend/test/gists.e2e.spec.tsdeleted. The tests that only existed there (out-of-range latitude, no coordinates, unknown fields, missinglat/lonon GET,limit, non-UUID id, SQL metacharacters in the id) are ported intogists.e2e-spec.tsusing its/v1routes and seeding helpers; the rest were already covered there ([Backend] Backend/test/gists.e2e.spec.ts never runs: wrong filename for both Jest configs #1602).Not done / partial / untested
npm test,npm run test:covornpm run test:e2e(the e2e suite needs a database).PaginationHelperandGistsControllerare unconfirmed./uuid/iagainstString(body.message)(the original expected an array), and the out-of-range-latitude test asserts only the status code. The stray file's/healthtest was dropped because the e2e spec already has one on/v1/health.limittest ran against an empty table; the ported one seeds three gists first.Merge notes
No overlap with the other PRs in this batch.
Closes #1602
Closes #1603
Closes #1604
Closes #1605