Skip to content

notification-service: DELETE /preferences/:address has zero test coverage; Store.getAllEnabledPreferences is dead code #339

Description

@abayomicornelius

Area

Notification Service / Testing

Complexity

Easy

File(s)

notification-service/src/api.ts (DELETE handler, lines 169-172); notification-service/src/db.ts (getAllEnabledPreferences, lines 127-134)

Problem

api.test.ts has no test exercising the DELETE /preferences/:address route at all — not the success path, not deleting a non-existent address. Separately, Store.getAllEnabledPreferences() in db.ts has no callers anywhere in src/ (not in index.ts, notifier.ts, or api.ts) and no test coverage — it reads as though it was meant to be the way the notifier fans out to eligible investors, but the actual data path goes through getInvestorsForProject instead.

Scope

In:

  • Add DELETE endpoint tests (existing address, non-existent address, verify idempotent 204); either wire getAllEnabledPreferences into an actual use case or remove it.

Out:

  • A broader API test refactor.

Acceptance Criteria

  • Test: DELETE on an existing preference removes it (subsequent GET returns 404)
  • Test: DELETE on a non-existent address still returns 204 (no error)
  • getAllEnabledPreferences is either covered by a test with a documented call site, or removed if confirmed unused

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomerstestingTests and test infrastructure

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions