Skip to content

Commit 9e5fc0b

Browse files
committed
test(generateMonthlySVG): verify auto-theme CSS variables
1 parent 5ec6322 commit 9e5fc0b

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

lib/svg/generator.test.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,6 @@ describe('generateMonthlySVG', () => {
965965
expect(svg).toContain('width="400"');
966966
expect(svg).toContain('height="200"');
967967
});
968-
969968
it('includes prefers-reduced-motion media query in static monthly SVG output', () => {
970969
const svg = generateMonthlySVG(mockMonthlyStats, {
971970
user: 'octocat',
@@ -987,6 +986,17 @@ describe('generateMonthlySVG', () => {
987986
expect(svg).toContain('transition: none !important');
988987
});
989988

989+
it('includes CSS variables in auto-theme monthly SVG', () => {
990+
const svg = generateMonthlySVG(mockMonthlyStats, {
991+
user: 'octocat',
992+
autoTheme: true,
993+
} as unknown as BadgeParams);
994+
995+
expect(svg).toContain('--cp-bg');
996+
expect(svg).toContain('--cp-accent');
997+
expect(svg).toContain('prefers-color-scheme: dark');
998+
});
999+
9901000
it('supports dynamic Google Fonts for non-predefined fonts in monthly auto-theme mode', () => {
9911001
const svg = generateMonthlySVG(mockMonthlyStats, {
9921002
user: 'octocat',

0 commit comments

Comments
 (0)