Is your feature request related to a problem? Please describe.
generateVersusSVG (and its internal generateAutoThemeVersusSVG branch) in lib/svg/generator.ts currently have no dedicated test coverage in lib/svg/generator.test.ts.
Every other SVG generator has direct tests:
- ✅
generateSVG
- ✅
generateMonthlySVG
- ✅
generateHeatmapSVG
- ✅
generatePulseSVG
- ✅
generateNotFoundSVG
- ✅
generateRateLimitSVG
- ❌
generateVersusSVG
This is particularly important because generateAutoThemeVersusSVG was recently refactored to replace hand-rolled tower rendering loops with renderTowers(), and there are no regression tests covering that code path.
A search of the test suite shows only a single "versus" reference, related to contrast logic rather than validating SVG output from generateVersusSVG.
Describe the solution you'd like
Add a describe('generateVersusSVG') block and a describe('generateVersusSVG auto-theme') block to lib/svg/generator.test.ts covering:
- Renders valid SVG (
<svg ... </svg>)
viewBox width equals double the single-panel width
- Contains VS divider circle and text
- Both usernames rendered in output
role="img", aria-labelledby, aria-describedby present
<title> includes both usernames
<desc> includes contribution counts for both users
- Winner gets crown emoji 👑; tied match produces no crown
- Dashed divider line between panels
- XML-reserved characters in usernames are escaped
hideBackground: true renders transparent background
Auto-theme:
- Injects
--cp-bg, --cp-accent, --cp-text CSS vars
- Includes
prefers-color-scheme: dark media query
- Uses
cp-accent-fill / cp-bg-fill classes instead of hardcoded hex values
Describe alternatives you've considered
No response
Is your feature request related to a problem? Please describe.
generateVersusSVG (and its internal generateAutoThemeVersusSVG branch) in
lib/svg/generator.tscurrently have no dedicated test coverage inlib/svg/generator.test.ts.Every other SVG generator has direct tests:
generateSVGgenerateMonthlySVGgenerateHeatmapSVGgeneratePulseSVGgenerateNotFoundSVGgenerateRateLimitSVGgenerateVersusSVGThis is particularly important because
generateAutoThemeVersusSVGwas recently refactored to replace hand-rolled tower rendering loops withrenderTowers(), and there are no regression tests covering that code path.A search of the test suite shows only a single
"versus"reference, related to contrast logic rather than validating SVG output fromgenerateVersusSVG.Describe the solution you'd like
Add a
describe('generateVersusSVG')block and adescribe('generateVersusSVG auto-theme')block tolib/svg/generator.test.tscovering:<svg ... </svg>)viewBoxwidth equals double the single-panel widthrole="img",aria-labelledby,aria-describedbypresent<title>includes both usernames<desc>includes contribution counts for both usershideBackground: truerenders transparent backgroundAuto-theme:
--cp-bg,--cp-accent,--cp-textCSS varsprefers-color-scheme: darkmedia querycp-accent-fill/cp-bg-fillclasses instead of hardcoded hex valuesDescribe alternatives you've considered
No response