From 9e5fc0b62f864dd937969059a905f514e7e7df65 Mon Sep 17 00:00:00 2001 From: Mayank Singh Rawat Date: Sun, 31 May 2026 04:46:57 +0530 Subject: [PATCH] test(generateMonthlySVG): verify auto-theme CSS variables --- lib/svg/generator.test.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/svg/generator.test.ts b/lib/svg/generator.test.ts index e15c1be1c..eb43cb4a7 100644 --- a/lib/svg/generator.test.ts +++ b/lib/svg/generator.test.ts @@ -965,7 +965,6 @@ describe('generateMonthlySVG', () => { expect(svg).toContain('width="400"'); expect(svg).toContain('height="200"'); }); - it('includes prefers-reduced-motion media query in static monthly SVG output', () => { const svg = generateMonthlySVG(mockMonthlyStats, { user: 'octocat', @@ -987,6 +986,17 @@ describe('generateMonthlySVG', () => { expect(svg).toContain('transition: none !important'); }); + it('includes CSS variables in auto-theme monthly SVG', () => { + const svg = generateMonthlySVG(mockMonthlyStats, { + user: 'octocat', + autoTheme: true, + } as unknown as BadgeParams); + + expect(svg).toContain('--cp-bg'); + expect(svg).toContain('--cp-accent'); + expect(svg).toContain('prefers-color-scheme: dark'); + }); + it('supports dynamic Google Fonts for non-predefined fonts in monthly auto-theme mode', () => { const svg = generateMonthlySVG(mockMonthlyStats, { user: 'octocat',