Skip to content

[BE-121] Unit tests for the verification module #980

Description

@mftee

Overview

backend/src/verification/ has 3 files, 1 entity, and no tests. Verification links a document to its on-chain proof, so a bug here produces a false claim of verification — actively worse than no verification at all.

Tasks

  • Test verification record creation and retrieval.
  • Test that verification of an unanchored document returns a clear negative rather than a false positive.
  • Test hash-mismatch handling: a document whose content no longer matches its anchored hash must be reported as failed verification, not as an error.
  • Test idempotency — verifying twice must not create duplicate records.
  • Test the failure path when the Stellar layer is unreachable: verification should report "unknown", never "verified".
  • Target ≥80% coverage.

Acceptance Criteria

  • A test proves an unanchored or mismatched document never reports as verified.
  • Stellar unavailability yields an explicit indeterminate state.
  • npm run test -- verification passes at ≥80% coverage.

Notes for Contributors

Comment below to be assigned.

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