Skip to content

[CT-19] Write integration tests for GET /verify/:hash/history #551

@mftee

Description

@mftee

Problem

The verify_document_history handler is implemented but has no test coverage. Regressions in history retrieval or cache interaction would go undetected, silently serving incorrect or empty verification histories.

Proposed Solution

Write integration tests using axum-test inside contract/module/tests/history_tests.rs.

Acceptance Criteria

  • Test: hash with no history returns 200 with an empty transactions array and count=0
  • Test: hash with multiple transfer records returns all records in the correct order
  • Test: cache hit path returns cached=true in the response
  • Test: invalid hash format returns 400 with a descriptive error message
  • Test: empty hash string returns 400
  • Test: hash with exactly one record returns count=1 and a single-item transactions array
  • All test files live inside contract/module/tests/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions