Skip to content

Add unit tests for the backend dto.ts chain-model to DTO mapping#1120

Merged
1nonlypiece merged 1 commit into
Commitlabs-Org:masterfrom
Baskarayelu:issue-989
Jun 29, 2026
Merged

Add unit tests for the backend dto.ts chain-model to DTO mapping#1120
1nonlypiece merged 1 commit into
Commitlabs-Org:masterfrom
Baskarayelu:issue-989

Conversation

@Baskarayelu

Copy link
Copy Markdown
Contributor

Closes #989

Summary

  • Add src/lib/backend/__tests__/dto.test.ts with comprehensive unit tests for mapCommitmentFromChain and mapAttestationFromChain
  • Tests cover happy path, optional/missing fields, numeric type conversions, and unknown status/verdict defaults
  • 11 test cases total across both mapping functions

Test coverage

  • mapCommitmentFromChain: full model mapping, XLM asset defaults, assetIssuer null for XLM, unknown commitmentType fallback, unknown/missing status fallback, all early_exit variants, numeric type coercions
  • mapAttestationFromChain: full model mapping, unknown verdict fallback, details field omission, ISO date fallback for undefined observedAt, numeric timestamp conversion

🤖 Generated with Claude Code

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

@Baskarayelu is attempting to deploy a commit to the 1nonly's projects Team on Vercel.

A member of the Team first needs to authorize it.

@1nonlypiece 1nonlypiece merged commit fa9de51 into Commitlabs-Org:master Jun 29, 2026
2 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit tests for the backend dto.ts chain-model to DTO mapping

2 participants