feat(testing): snapshot tests, SEP-24 integration, API coverage enforcement, and webhook chaos tests#1035
Merged
Haroldwonder merged 2 commits intoJun 30, 2026
Conversation
…ting, and chaos tests Closes Haroldwonder#931 — Vitest snapshot tests for SendMoneyFlow, TransactionHistory, AgentPanel, and CorridorAnalytics; Storybook 8 stories for visual regression; CI workflow enforces snapshot freshness on every PR. Closes Haroldwonder#928 — Vitest V8 coverage provider with 80% line / 75% branch thresholds; --coverage wired into CI; coverage report published to GitHub Actions PR summary. Closes Haroldwonder#927 — Sep24Client service with initiateDeposit / pollUntilComplete; unit tests covering the happy path, expiry, and refund flows; integration test suite that runs against a real Anchor Platform (Docker) in nightly CI with SEP-10 JWT auth; Docker Compose for local reproduction. Closes Haroldwonder#930 — WebhookDelivery service with exponential backoff and in-memory DLQ; Toxiproxy Docker Compose for network fault injection; chaos test suite covering 1s latency, connection reset, 30s timeout, and backoff growth; DLQ receipt verified under each fault; runs nightly in CI.
|
@rejoicetukura-blip is attempting to deploy a commit to the Harold's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@rejoicetukura-blip 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR implements the full test infrastructure requested across four issues, covering frontend visual regression, SEP-24 flow integration, API coverage enforcement, and webhook reliability under adverse network conditions.
closes #931 — Frontend Snapshot Tests
What was added
SendMoneyFlow,TransactionHistory,AgentPanel,CorridorAnalyticsDefault,Loading,Empty, variant stories)frontend/vitest.config.tsconfigured withjsdomenvironment, V8 coverage, and snapshot format options.github/workflows/frontend-snapshot-tests.yml) that runs snapshots on every PR touchingfrontend/, builds Storybook, and fails if any snapshot would change without a deliberate updateSnapshot update workflow: run
npm run test:snapshot:updateinsidefrontend/, review the diff, commit.closes #928 — API Service Coverage Reporting
What was added
api/vitest.config.ts— V8 coverage provider with thresholds: 80% lines, 75% branches, 80% functions, 80% statementsnpm run test:coveragescript added toapi/package.json.github/workflows/api-coverage.yml) that:vitest run --coverageon every PR touchingapi/closes #927 — SEP-24 Deposit Integration Tests
What was added
api/src/services/sep24.ts—Sep24Clientclass:initiateDeposit(),getTransaction(),pollUntilComplete()(with configurable interval/timeout)api/src/__tests__/sep24.test.ts— unit tests using mocked axios (happy path, expiry, refund, timeout, header assertions)api/src/__tests__/sep24-deposit.integration.test.ts— integration test suite that runs against a real Anchor Platform:expiredterminal staterefundedwith refunds object populatedtests/docker/sep24-docker-compose.yml— Anchor Platform 3.0.0 + Stellar Quickstart for local/CI reproductionapi/vitest.integration.config.ts— separate Vitest config with 120s timeout for integration suite.github/workflows/sep24-integration-tests.yml) — nightly cron at 02:00 UTC; spins up Docker, obtains SEP-10 JWT, runs integration tests, tears down and publishes summaryLocal run:
closes #930 — Webhook Chaos Tests
What was added
api/src/services/webhook.ts—deliverWebhook()with exponential backoff (baseDelay × 2^attempt, capped atmaxDelayMs), configurable retry count, per-event timeout, and an in-memory DLQ;getDLQ()/clearDLQ()for test inspectionapi/src/__tests__/webhook.test.ts— unit tests: success on first attempt, retry on 503, DLQ after exhausting retries, no retry on 4xx, correct headers, multiple independent DLQ entriesapi/src/__tests__/webhook-chaos.chaos.test.ts— chaos tests using Toxiproxy management API:latencytoxic) — delivers within timeoutreset_peertoxic) — retries and DLQs after max retriestimeouttoxic, 3 s webhook timeout fires first) — DLQs after max retriessetTimeoutspy grows monotonicallytests/docker/chaos-docker-compose.yml— Toxiproxy 2.9.0 + Node echo servertests/docker/webhook-echo-server.js— minimal HTTP echo server (POST/webhook→ 200, GET/health→ 200)api/vitest.chaos.config.ts— sequential fork pool (Toxiproxy state is shared), 180 s timeout.github/workflows/webhook-chaos-tests.yml) — nightly cron at 03:00 UTC; provisions infrastructure, runs chaos suite, publishes fault/behaviour table to step summaryLocal run:
Files changed
frontend/api/src/services/webhook.tsapi/src/services/sep24.tsapi/src/__tests__/webhook.test.tsapi/src/__tests__/sep24.test.tsapi/src/__tests__/sep24-deposit.integration.test.tsapi/src/__tests__/webhook-chaos.chaos.test.tsapi/vitest.config.tsapi/vitest.integration.config.tsapi/vitest.chaos.config.tstests/docker/sep24-docker-compose.ymltests/docker/chaos-docker-compose.ymltests/docker/webhook-echo-server.js.github/workflows/frontend-snapshot-tests.yml.github/workflows/api-coverage.yml.github/workflows/sep24-integration-tests.yml.github/workflows/webhook-chaos-tests.ymlCloses #931
Closes #928
Closes #927
Closes #930