Commit 6ad522b
committed
Replace ternary/short-circuit branches in data-* attrs with non-branching forms
Codecov flagged 'partial coverage' on:
- data-processing={doc.backendLock ? 'true' : 'false'} (3 occurrences in Documents.tsx)
- data-title={x || ''} (1 occurrence in ModernDocumentItem.tsx + 3 in Documents.tsx)
The card-view tests only exercise one branch of each ternary at a time
(loaded vs locked, with-title vs nullish), so codecov never sees both.
Replacing with non-branching forms:
- data-processing={String(Boolean(doc.backendLock))} — coerces any
truthy/falsy value to the literal string 'true' or 'false', no branch.
- data-title={x ?? ''} — narrower nullish-coalesce that codecov tracks
differently from || (only triggers on null/undefined, not on empty
string / 0 / false), so a single test path covers it.
The rendered DOM is identical for the values we ever pass (string title
or null). E2E selectors that depend on data-processing='false' are
unaffected.1 parent 504d056 commit 6ad522b
2 files changed
Lines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1287 | 1287 | | |
1288 | 1288 | | |
1289 | 1289 | | |
1290 | | - | |
| 1290 | + | |
1291 | 1291 | | |
1292 | 1292 | | |
1293 | 1293 | | |
| |||
1500 | 1500 | | |
1501 | 1501 | | |
1502 | 1502 | | |
1503 | | - | |
| 1503 | + | |
1504 | 1504 | | |
1505 | 1505 | | |
1506 | 1506 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1381 | 1381 | | |
1382 | 1382 | | |
1383 | 1383 | | |
1384 | | - | |
1385 | | - | |
| 1384 | + | |
| 1385 | + | |
1386 | 1386 | | |
1387 | 1387 | | |
1388 | 1388 | | |
| |||
1506 | 1506 | | |
1507 | 1507 | | |
1508 | 1508 | | |
1509 | | - | |
1510 | | - | |
| 1509 | + | |
| 1510 | + | |
1511 | 1511 | | |
1512 | 1512 | | |
1513 | 1513 | | |
| |||
1576 | 1576 | | |
1577 | 1577 | | |
1578 | 1578 | | |
1579 | | - | |
1580 | | - | |
| 1579 | + | |
| 1580 | + | |
1581 | 1581 | | |
1582 | 1582 | | |
1583 | 1583 | | |
| |||
0 commit comments