Skip to content

Content module has no tests: page, banner, FAQ, and legal CRUD is uncovered #1129

Description

@nanaf6203-bit

Content module has no tests: page, banner, FAQ, and legal CRUD is uncovered

Labels / Complexity: testing · Medium Complexity — Medium

Problem

src/content/ (3 files, 0 *.spec.ts) implements page, banner, FAQ, and legal content management — currently entirely in-memory (src/content/content.service.ts). There are no tests for any of the CRUD paths, so nothing pins the current behavior before the durability migration (#51) lands. Combined with the unauthenticated write routes (#39), this module is both untested and unauthenticated.

Why this is architecturally hard

  1. Tests must pin behavior that is about to change. The in-memory semantics (identity via Date.now(), array ordering) need tests written against the durable contract so the migration in Caching stradedy #51 cannot silently change them.
  2. CRUD-per-type × auth. With Implement Comprehensive API Rate Limiting and Security #39 and Caching stradedy #51 landing, tests should cover both the data behavior and the access rules once guards exist.

Acceptance criteria

  • Tests cover create/read/update for pages, banners, FAQs, and legal content, including the not-found paths.
  • Tests run in CI via npm test.
  • The PR reports the module's coverage change (npm run test:cov).

Out of scope

Making content durable (#51); adding auth (#39).

Getting started

  • src/content/content.service.ts — the CRUD to cover
  • src/content/content.controller.ts — the routes

Commands: npm test, npm run test:cov.

Good first files to read: src/content/content.service.ts, src/content/content.controller.ts.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions