Commit 58b8f90
authored
test(layout): verify row and col mapping (JhaSourav07#975)
## Description
Closes JhaSourav07#730
Added test coverage to verify that `TowerData.row` and `TowerData.col`
are correctly mapped to the week index and day index in `computeTowers`.
### What Changed
* Added a layout test using a 2-week × 3-day mock contribution calendar
* Verified the first tower maps to `row=0`, `col=0`
* Verified the second tower maps to `row=0`, `col=1`
* Verified the first tower of the second week maps to `row=1`, `col=0`
* Ensured all existing layout tests continue to pass successfully
### Why
`row` and `col` values are used to calculate staggered SVG animation
delays.
These tests help prevent regressions where week/day indices could
accidentally become swapped, which would cause incorrect animation
ordering in the visualization.
## Pillar
* [ ] 🎨 Pillar 1 — New Theme Design
* [ ] 📐 Pillar 2 — Geometric SVG Improvement
* [ ] 🕐 Pillar 3 — Timezone Logic Optimization
* [x] 🛠️ Other (Bug fix, refactoring, docs
## 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 lint` locally and resolved all errors (CI will
fail otherwise).
* [x] I have run the relevant Vitest test suite successfully.
* [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.
* [x] I have starred the repo.
* [x] I have made sure that I have only one commit to merge in this PR.1 file changed
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
0 commit comments