Skip to content

test(card): regression guard for the blank share-asset capture#2305

Merged
Hugo0 merged 1 commit into
mainfrom
test/share-asset-capture-readiness
Jun 29, 2026
Merged

test(card): regression guard for the blank share-asset capture#2305
Hugo0 merged 1 commit into
mainfrom
test/share-asset-capture-readiness

Conversation

@Hugo0

@Hugo0 Hugo0 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Definitive verification + permanent guard for the blank-share-asset fix (#2302, merged).

The blank asset was a timing race: the card-face hand is an async-mounted <canvas>, and html-to-image can't wait for a not-yet-mounted canvas, so a fast/first-of-session capture snapshotted a blank card. That race can't be reproduced on-demand, so the definitive check is a unit test of the gate logic:

  • Export waitForAssetReady with an injectable timeout (so the bounded-wait is testable without a 2.5s test).
  • does NOT resolve until the card-face <canvas> has mounted — proves capture blocks until the hand canvas is present (a snapshot before it would be blank).
  • never hangs (bounded timeout), awaits every <img>.decode(), awaits document.fonts.ready.

6/6 pass, prettier + typecheck clean. Off main; back-merge to dev.

Export waitForAssetReady (with an injectable timeout) and add 4 tests proving the capture gate blocks the html-to-image snapshot until the async card-face <canvas> has mounted — the exact element whose absence produced the launch-day blank share asset (#2302) — plus: bounded so it never hangs, awaits every <img>.decode(), and awaits document.fonts.ready. 6/6 pass.
@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
peanut-wallet Ready Ready Preview, Comment Jun 29, 2026 1:51pm

Request Review

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 7 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 66260e83-92be-408a-a517-31aa0817cb30

📥 Commits

Reviewing files that changed from the base of the PR and between 55f7677 and 4b0c8e3.

📒 Files selected for processing (2)
  • src/components/Card/share-asset/__tests__/captureShareAsset.test.ts
  • src/components/Card/share-asset/captureShareAsset.ts

Comment @coderabbitai help to get the list of available commands.

@Hugo0 Hugo0 merged commit 1bd95df into main Jun 29, 2026
16 of 19 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Code-analysis diff

Painscore total: 5843.65 → 5843.65 (0)
Findings: 0 net (+0 new, -0 resolved)

@github-actions

Copy link
Copy Markdown
Contributor

🧪 UI test report — ✅ all green

Suites

  • unit: 1605 ran, 0 failed, 0 skipped, 25.5s

📊 Coverage (unit)

metric %
statements 54.5%
branches 37.0%
functions 42.2%
lines 54.4%
⏱ 10 slowest test cases
time test
3.8s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › never places two stickers in heavy overlap (broad seed sweep)
0.6s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › every sticker stays within canvas at any count
0.3s src/app/actions/__tests__/api-headers.test.ts › should include Content-Type in updateUserById
0.3s src/app/actions/__tests__/api-headers-extended.test.ts › should not include apiKey in updateUserById body
0.2s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › Manteca PIX form ready shows merchant card + amount input + pay button
0.1s src/components/Global/GeneralRecipientInput/__tests__/GeneralRecipientInput.test.tsx › should handle valid 9-digit US account
0.1s src/components/Global/GeneralRecipientInput/__tests__/GeneralRecipientInput.test.tsx › should handle too long for US account
0.1s src/components/Global/GeneralRecipientInput/__tests__/GeneralRecipientInput.test.tsx › should handle valid UK IBAN with spaces
0.1s src/components/Global/GeneralRecipientInput/__tests__/GeneralRecipientInput.test.tsx › should handle valid Italian IBAN
0.1s src/components/Global/GeneralRecipientInput/__tests__/GeneralRecipientInput.test.tsx › should handle maximum length (17 digits) US account
📍 Inline annotations are in the **Unit test report** check above. Coverage artifact: `coverage-unit`. Generated by `.github/workflows/tests.yml`.

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