Skip to content

feat(qr-pairing): add branch-coverage tests for qr-pairing.tsx - #577

Merged
d-oit merged 1 commit into
mainfrom
feat/qr-pairing-branch-coverage
Jul 31, 2026
Merged

feat(qr-pairing): add branch-coverage tests for qr-pairing.tsx#577
d-oit merged 1 commit into
mainfrom
feat/qr-pairing-branch-coverage

Conversation

@d-oit

@d-oit d-oit commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Branch Coverage: qr-pairing.tsx (54.83% -> ~80% branches)

What

13 targeted tests covering key branches in the qr-pairing.tsx component.

Coverage Areas

Area Tests
QRDisplay copy state check icon after copy, 2s reset via fake timers
QRScanner startCamera success path, Error rejection (message + toast), non-Error rejection (generic message)
QRScanner stopCamera stop button click, unmount, unmount without stream
Barcode detection loop barcode found calls onScan, no barcode reschedules RAF, detect reject reschedules, BarcodeDetector unavailable reschedules
onScanRef updates on rerender (latest callback used)

Notes

  • Mocks: qrcode.react, lucide-react, sonner, navigator.clipboard, navigator.mediaDevices, window.BarcodeDetector, requestAnimationFrame (spy capture), canvas getContext
  • Cleanup in afterEach: RAF/getContext/play spies restored, mediaDevices + BarcodeDetector defineProperties cleaned up, fake timers reset

@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
do-knowledge-studio Ready Ready Preview, v0 Jul 31, 2026 10:07am

@github-actions github-actions Bot added config tests Related to automated/manual tests labels Jul 31, 2026
@codacy-production

Copy link
Copy Markdown
Contributor

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@d-oit
d-oit merged commit 2914a54 into main Jul 31, 2026
23 checks passed
@d-oit
d-oit deleted the feat/qr-pairing-branch-coverage branch July 31, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config tests Related to automated/manual tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant