Skip to content

test: add integration test for ledgerToTimestamp (#461)#467

Merged
Chucks1093 merged 1 commit into
accesslayerorg:devfrom
Kaycee276:fix/461-ledger-timestamp-test
Jun 26, 2026
Merged

test: add integration test for ledgerToTimestamp (#461)#467
Chucks1093 merged 1 commit into
accesslayerorg:devfrom
Kaycee276:fix/461-ledger-timestamp-test

Conversation

@Kaycee276

Copy link
Copy Markdown
Contributor

Description

Closes #461

This PR adds an integration test for the ledgerToTimestamp helper to confirm its timestamp estimation accuracy using known, hardcoded reference values. This ensures the conversion logic is fully verified before the helper is adopted in the production UI.

The integration test explicitly verifies the helper against a known reference point (Ledger 50,000,000 at 2024-01-01T00:00:00.000Z) to satisfy all acceptance criteria:

  • Equal Ledger: Asserts that passing a ledger equal to the reference returns the exact reference timestamp.
  • Future Ledger: Asserts that passing a ledger 100 sequences ahead of the reference returns an estimated date exactly 500 seconds later.
  • Past Ledger: Asserts that passing a ledger 100 sequences behind the reference returns an estimated date exactly 500 seconds earlier.

Changes

  • Created a new test file: src/utils/__tests__/stellarLedger.integration.test.ts to cleanly separate the integration test with hardcoded data from the standard unit tests.

Verification

  • Verified locally via pnpm test src/utils/__tests__/stellarLedger.integration.test.ts. All 3 tests pass successfully.

@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

@Kaycee276 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Chucks1093 Chucks1093 merged commit ce35318 into accesslayerorg:dev Jun 26, 2026
1 check 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 integration test for ledger to timestamp helper returning correct estimated date

2 participants