Repository navigation
test(web): DepositWizard receipt txHash truncation and omission (#671) - #1260
Merged
vjuliaife merged 2 commits intoOct 18, 2026
Merged
Conversation
…ife#671) Asserts the receipt link text is the first 16 characters plus an ellipsis, the explorer href still uses the full hash, and the full hash never appears in the receipt text.
…aife#671) Covers undefined, null and empty txHash (no link, no error), and checks the amount and bucket label still render next to the truncated hash, with the expected api.deposit arguments.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@prodbycorne 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! 🚀 |
prodbycorne
force-pushed
the
test/671-deposit-wizard-receipt
branch
from
October 18, 2026 14:57
1cae90c to
2c80a6a
Compare
|
Deployment failed for project tariff-shield-web with the following error: Learn More: https://vercel.com/docs/concepts/projects/project-configuration |
This branch had an error being deployed
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.
Summary
Adds unit tests for the
DepositWizardreceipt step (apps/web/components/DepositWizard.tsx, the conditional txHash line). The receipt shows{txHash.slice(0, 16)}… ↗when a hash is present and leaves the line out when it isn't.Changes
New
apps/web/components/__tests__/DepositWizard.receipt.test.tsx, in the same vitest + Testing Library style as the existingNav.*.test.tsxcomponent tests:api.depositis mocked through@/lib/api, including anApiErrorstub becauseerror-formatterimports it from the same module.… ↗, and the explorerhrefstill uses the full hashtxHashofundefined/null/'': no link, no… ↗, andsetErrorisn't called with an error50 XLM deposited to reserve (auto-top-up pool)) render next to the truncated hash;api.depositgets{ amountStroops: '500000000', bucket: 'reserve' }Note on "not rendered anywhere": the explorer link's
hrefcontains the full hash by design, because it's what opens the transaction on stellar.expert. The test asserts on the receipt's text, and separately checks that thehrefis the full-hash explorer URL.How this was verified
apps/webhas no test runner configured: no vitest dependency, config ortestscript. That's an existing gap, and the existingNav.*.test.tsxfiles are in the same position.npm installin this repo also fails on macOS/Linux because of a lockfile entry (@rollup/plugin-commonjs@28.0.1is pinned toos: win32), so I didn't change the repo's dependencies here.I ran the new file with a throwaway vitest 3.2.4 + jsdom + Testing Library setup pointed at
apps/web(with the@/alias):slice(0, 20)makes the 3 truncation tests fail (the omission tests still pass, as expected), so the assertions really test the truncation. The component change was reverted.A follow-up should add vitest + jsdom +
@testing-library/*toapps/webwith atestscript (and fix the win32-only lockfile entry), so these component tests run in CI.Closes #671
Closes #670
Closes #668
Closes #669