test: SequencerFeeRow coverage + sequencer getBlockNumber fragility fix#23
Conversation
previewBlock is informational metadata, so a failed block-number lookup must not discard an otherwise valid gasEstimateComponents result. Isolate the getBlockNumber call in its own best-effort helper (previewBlock degrades to undefined) instead of letting a rejection reject the whole preview. Covered by a TDD red-green test.
…ates Add a jsdom + testing-library vitest setup for the arbitrum-london example (React SWC transform, reused @/* path alias) and a SequencerFeeRow spec covering the three render states: the estimating hint while the request is in flight, nothing once the preview resolves to null, and the L1/L2/total rows once it resolves with data. previewSequencerFee is mocked, so the test needs no RPC or live contracts.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
# Conflicts: # examples/arbitrum-london/package.json # pnpm-lock.yaml
|
Deployment failed with the following error: Learn More: https://vercel.com/mikediamonds-projects?upgradeToPro=build-rate-limit |
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
What
Closes the test-coverage gaps from the Buildathon work (item 3, post #22). Two logical changes, two commits:
previewSequencerFeeno longer discards a valid fee whengetBlockNumberrejects.previewBlockis informational metadata, so the block lookup is now best-effort in its own try/catch and degrades toundefined; an RPC hiccup on the block height can no longer null out a goodgasEstimateComponentsestimate. Written TDD (red, then green).SequencerFeeRowspec covering its three render states.Tests
@txkit/arbitrum-adapter: 24 passing (was 23, +1 fragility test) + typecheck clean@txkit/example-arbitrum-london: 3 passing (new suite, fully mocked - no RPC, no contracts)pnpm test(turbo): 15/15 tasks green - the example suite now runs in CICoverage notes
Covered:
previewSequencerFeeblock-number resilience (the fix above)SequencerFeeRow: estimating hint while in flight / renders nothing when the preview is null / L1 + L2 + total rows when it resolves with dataConsciously skipped (YAGNI for the hackathon):
PolicyStatusBadge,ChatMessage- trivial presentational render, near-zero ROI, covered by the visual demoEnvelopePreview/CopyableValuerender tests - optional, lower priority, deferredSequencerFeeRowchainId hardcode (the in-browserfeeClientis pinned to Arbitrum Sepolia) - left as-is: the demo is Sepolia-only and the component JSDoc says so. The new test pins current behavior, so deriving the client from thechainprop later becomes a deliberate, test-visible change.Notes
testscript, so it joinspnpm testunder turbo in CI. The spec mockspreviewSequencerFee, so it is deterministic and needs no network.@vitejs/plugin-react-swcfor the JSX transform (lighter peer footprint than the babel plugin under vite 8). It prints a cosmetic "switch to @vitejs/plugin-react" perf hint - harmless for 3 tests.array-bracket-spacingnits on untouched lines in the adapter spec are not touched here (out of scope; the adapter's CI lint istsc, not eslint).Not merging - leaving open for review.