From 7ce709363e9b6634e8bcc60494c722c0bd5bc114 Mon Sep 17 00:00:00 2001 From: Adeel Raza Date: Tue, 11 Aug 2026 20:19:28 +0400 Subject: [PATCH] Exclude React-version selection glue from coverage 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). --- src/EmailEditor.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/EmailEditor.tsx b/src/EmailEditor.tsx index 0ca70c23..633ac36d 100644 --- a/src/EmailEditor.tsx +++ b/src/EmailEditor.tsx @@ -29,11 +29,18 @@ const useCounterEditorId = (): string => // mismatch that otherwise leaves the editor mounting against a stale server id // (blank editor) under SSR/Next.js. The implementation is picked once at module // load (stable for the app's lifetime), so the same hook runs on every render. +// +// v8 ignore: this is React-version selection glue. The two arms are covered by +// separate suites (useId by the React 18/19 tests, the counter by the React +// 16/17 smoke suite) but never within a single coverage run, so the untaken +// arm always reads as a partial branch. +/* v8 ignore start */ const useGeneratedEditorId: () => string = typeof React.useId === 'function' ? // Strip ':' so the id is a valid CSS selector for unlayer.createEditor. () => `editor-${React.useId().replace(/:/g, '')}` : useCounterEditorId; +/* v8 ignore stop */ function EmailEditorInner< TDisplayMode extends DisplayMode | undefined = 'email',