Skip to content

test: SequencerFeeRow coverage + sequencer getBlockNumber fragility fix#23

Merged
mike-diamond merged 3 commits into
mainfrom
test/arbitrum-coverage
Jun 2, 2026
Merged

test: SequencerFeeRow coverage + sequencer getBlockNumber fragility fix#23
mike-diamond merged 3 commits into
mainfrom
test/arbitrum-coverage

Conversation

@mike-diamond

Copy link
Copy Markdown
Contributor

What

Closes the test-coverage gaps from the Buildathon work (item 3, post #22). Two logical changes, two commits:

  1. fix(arbitrum-adapter) - previewSequencerFee no longer discards a valid fee when getBlockNumber rejects. previewBlock is informational metadata, so the block lookup is now best-effort in its own try/catch and degrades to undefined; an RPC hiccup on the block height can no longer null out a good gasEstimateComponents estimate. Written TDD (red, then green).
  2. test(example) - first jsdom + testing-library vitest setup in the repo, plus a SequencerFeeRow spec 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)
  • Full pnpm test (turbo): 15/15 tasks green - the example suite now runs in CI

Coverage notes

Covered:

  • previewSequencerFee block-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 data

Consciously skipped (YAGNI for the hackathon):

  • PolicyStatusBadge, ChatMessage - trivial presentational render, near-zero ROI, covered by the visual demo
  • EnvelopePreview / CopyableValue render tests - optional, lower priority, deferred
  • SequencerFeeRow chainId hardcode (the in-browser feeClient is 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 the chain prop later becomes a deliberate, test-visible change.

Notes

  • The example gains a test script, so it joins pnpm test under turbo in CI. The spec mocks previewSequencerFee, so it is deterministic and needs no network.
  • Uses @vitejs/plugin-react-swc for 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.
  • Pre-existing array-bracket-spacing nits on untouched lines in the adapter spec are not touched here (out of scope; the adapter's CI lint is tsc, not eslint).

Not merging - leaving open for review.

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.
@vercel

vercel Bot commented Jun 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
txkit-docs Ready Ready Preview, Comment Jun 2, 2026 11:36am
txkit-land Ready Ready Preview, Comment Jun 2, 2026 11:36am
txkit-story Ready Ready Preview, Comment Jun 2, 2026 11:36am

# Conflicts:
#	examples/arbitrum-london/package.json
#	pnpm-lock.yaml
@vercel

vercel Bot commented Jun 2, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/mikediamonds-projects?upgradeToPro=build-rate-limit

@socket-security

Copy link
Copy Markdown

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.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm entities is 91.0% likely obfuscated

Confidence: 0.91

Location: Package overview

From: pnpm-lock.yamlnpm/entities@4.5.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/entities@4.5.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm entities is 91.0% likely obfuscated

Confidence: 0.91

Location: Package overview

From: pnpm-lock.yamlnpm/@astrojs/mdx@5.0.4npm/entities@6.0.1

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/entities@6.0.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@mike-diamond mike-diamond merged commit 62c6db3 into main Jun 2, 2026
10 of 15 checks passed
@mike-diamond mike-diamond deleted the test/arbitrum-coverage branch June 4, 2026 09:17
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.

1 participant