Commit 0167fb3
authored
merge: test: Implement Visual Regression Testing for SVG Generators (#8115)
## Description
Fixes #7794
### Summary
This PR implements visual regression testing for the project's SVG
generators using **Vitest**, **@resvg/resvg-js**, and **pixelmatch**.
### Changes
* Added a visual regression test suite covering all primary SVG
generators.
* Added baseline PNG snapshots for visual comparison.
* Added `test:visual` and `test:visual:update` scripts.
* Added `pixelmatch`, `pngjs`, and related development dependencies.
* Configured CI to upload visual regression diff artifacts when tests
fail.
* Ignored generated visual diff outputs via `.gitignore`.
* Fixed `font-family` quoting in the Versus SVG generators to ensure
valid SVG rendering during visual regression testing.
## 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 (Tooling / Testing change)
## Checklist before requesting a review:
* [x] I have read the `CONTRIBUTING.md` file.
* [x] I have tested these changes locally
(`localhost:3000/api/streak?user=YOUR_USERNAME`).
* [x] I have run `npm run format` and `npm run lint` locally and
resolved all errors (CI will fail otherwise).
* [x] My commits follow the Conventional Commits format (e.g.,
`feat(themes): ...`, `fix(calculate): ...`).
* [ ] 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 "premium quality" aesthetic
standard.
* [x] (Recommended) I joined the CommitPulse Discord community for
contributor discussions, mentorship, and faster PR support.
### Local Verification
* ✅ `npm run test:visual`
* Test Files: **1 passed (1)**
* Tests: **20 passed (20)**
* ✅ `npm test`
* Test Files: **1333 passed | 2 skipped**
* Tests: **9283 passed | 1 expected fail | 14 skipped**26 files changed
Lines changed: 403 additions & 2 deletions
File tree
- .github/workflows
- lib/svg
- tests/visual
- baselines
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
50 | 58 | | |
51 | 59 | | |
52 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2488 | 2488 | | |
2489 | 2489 | | |
2490 | 2490 | | |
2491 | | - | |
| 2491 | + | |
2492 | 2492 | | |
2493 | 2493 | | |
2494 | 2494 | | |
| |||
2595 | 2595 | | |
2596 | 2596 | | |
2597 | 2597 | | |
2598 | | - | |
| 2598 | + | |
2599 | 2599 | | |
2600 | 2600 | | |
2601 | 2601 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
| 79 | + | |
| 80 | + | |
77 | 81 | | |
78 | 82 | | |
79 | 83 | | |
80 | 84 | | |
81 | 85 | | |
82 | 86 | | |
| 87 | + | |
83 | 88 | | |
84 | 89 | | |
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
88 | 93 | | |
89 | 94 | | |
| 95 | + | |
| 96 | + | |
90 | 97 | | |
91 | 98 | | |
92 | 99 | | |
| |||
Loading
Loading
Loading
Loading
0 commit comments