Skip to content

Commit 89effb5

Browse files
authored
test(generateMonthlySVG): verify custom width and height appear in SVG viewBox (JhaSourav07#1172)
Fixes JhaSourav07#1050 ## Description Added a test to verify that `generateMonthlySVG` correctly reflects custom `width` and `height` values in the SVG `viewBox`. ## Pillar * [ ] 🎨 Pillar 1 — New Theme Design * [ ] 📐 Pillar 2 — Geometric SVG Improvement * [ ] 🕐 Pillar 3 — Timezone Logic Optimization * [x] 🛠️ Other (Bug fix, refactoring, docs) ## Visual Preview N/A (test-only change) ## Checklist before requesting a review: * [x] I have read the `CONTRIBUTING.md` file. * [x] I have tested these changes locally (`npm test lib/svg/generator.test.ts`). * [x] I have run `npm run format` and `npm run lint` locally and resolved all errors (CI will verify). * [x] My commits follow the Conventional Commits format. * [ ] I have updated `README.md` if I added a new theme or URL parameter. (Not applicable) * [x] I have starred the repo. * [x] I have made sure that I have only one commit to merge in this PR. * [x] The SVG output matches the CommitPulse quality standards. * [x] I joined the CommitPulse Discord community.
1 parent 9ba96d6 commit 89effb5

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

lib/svg/generator.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,16 @@ describe('generateMonthlySVG', () => {
745745
expect(svg).toContain('+40% (+12)');
746746
});
747747

748+
it('includes custom dimensions in viewBox', () => {
749+
const svg = generateMonthlySVG(mockMonthlyStats, {
750+
user: 'octocat',
751+
width: 400,
752+
height: 200,
753+
} as unknown as BadgeParams);
754+
755+
expect(svg).toContain('viewBox="0 0 400 200"');
756+
});
757+
748758
it('respects custom width and height parameters', () => {
749759
const svg = generateMonthlySVG(mockMonthlyStats, {
750760
user: 'octocat',

0 commit comments

Comments
 (0)