Skip to content

Exclude React-version selection glue from coverage (fix codecov/patch on master) - #516

Merged
adeelraza merged 1 commit into
masterfrom
claude/fix-codecov-patch-coverage
Aug 11, 2026
Merged

Exclude React-version selection glue from coverage (fix codecov/patch on master)#516
adeelraza merged 1 commit into
masterfrom
claude/fix-codecov-patch-coverage

Conversation

@adeelraza

Copy link
Copy Markdown
Contributor

Fixes the red codecov/patch check on master (introduced by #514). No build or test was ever broken — this is a coverage-gate artifact.

Cause

#514 added the useId/counter selection ternary for the SSR editor-id fix. In any single coverage run one arm is always unreachable:

  • the run uses React 18/19, so typeof React.useId === 'function' is true and the counter fallback arm never executes;
  • the React 16/17 path that would hit it is the test:legacy smoke suite, which runs without coverage by design (@testing-library/react needs React 18+).

So line 33 is a partial branch on a new line → codecov/patch < 100% → red.

Fix

The fallback function was already v8 ignore-d; this extends the ignore over the selection ternary itself. Comment-only — no logic changes.

Verification (local)

  • EmailEditor.tsx branch coverage 94.28% → 96.96%; line 33 no longer reported. The only remaining uncovered branch is the pre-existing typeof window SSR guard (line 16), which isn't part of any patch, so it won't trip codecov/patch.
  • npm test (12/12), npm run typecheck, npm run lint — clean.

The useId/counter selection ternary added in #514 always leaves one arm
uncovered in any single coverage run: the run uses React 18/19 (so useId is
picked) and the React 16/17 counter fallback is exercised only by the
test:legacy smoke suite, which runs without coverage. That partial branch on
a new line tripped codecov/patch on master.

The fallback function was already v8-ignored; extend the ignore over the
selection ternary too. Comment-only change, no logic touched. EmailEditor.tsx
branch coverage 94.28% -> 96.96% (the remaining uncovered branch is the
pre-existing typeof-window SSR guard, unrelated to any patch).
@adeelraza
adeelraza merged commit 6fa7ae9 into master Aug 11, 2026
13 checks passed
@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.43%. Comparing base (3a9fff2) to head (7ce7093).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #516      +/-   ##
==========================================
+ Coverage   96.25%   97.43%   +1.18%     
==========================================
  Files           2        2              
  Lines          80       78       -2     
  Branches       20       20              
==========================================
- Hits           77       76       -1     
+ Partials        3        2       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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