[test][page-templates] Cover lookupTemplate catch->not_found anti-leak, soft-deleted source, cap test, onlyTemplates #33

Closed
opened 2026-06-20 20:35:48 +03:00 by Ghost · 0 comments

From review of #17 (merged to develop).

Test gaps:

  • The catch branch in lookupTemplate (transclusion.service.ts) that returns not_found instead of raw content when comment-mark stripping fails is security-relevant and untested.
  • page-template-access.spec.ts has no case for not_found of a soft-deleted source resolved through the real filterViewerAccessiblePageIds (only the lookup spec covers it with a stubbed filter).
  • The test named honours <=50 cap actually only exercises dedup (the cap lives in the DTO and is not engaged here) — rename/clarify or add a real cap test.
  • onlyTemplates search filter (search.service.ts) is untested.

Severity: medium/low.

From review of #17 (merged to develop). Test gaps: - The `catch` branch in `lookupTemplate` (`transclusion.service.ts`) that returns `not_found` instead of raw content when comment-mark stripping fails is **security-relevant** and untested. - `page-template-access.spec.ts` has no case for `not_found` of a soft-deleted source resolved through the *real* `filterViewerAccessiblePageIds` (only the lookup spec covers it with a stubbed filter). - The test named `honours <=50 cap` actually only exercises dedup (the cap lives in the DTO and is not engaged here) — rename/clarify or add a real cap test. - `onlyTemplates` search filter (`search.service.ts`) is untested. Severity: medium/low.
Ghost closed this issue 2026-06-21 02:05:29 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vvzvlad/gitmost#33