Skip to content

Commit a7dd9a1

Browse files
Add assertion for non-ghost towers in active calendar (JhaSourav07#958)
## Description Adds an assertion to verify that all towers have `isGhost === false` when the calendar contains at least one contribution. closes JhaSourav07#729 ## 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 ## 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`). - [ ] 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. - [X] I have started 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 (no raw elements, smooth animations, correct fonts). - [X] (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.
1 parent 0d4d1d4 commit a7dd9a1

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

lib/svg/layout.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ describe('computeTowers edge cases', () => {
142142
],
143143
} as unknown as ContributionCalendar;
144144
const towers = computeTowers(calendar, 'linear', '2024-06-10');
145+
expect(towers.every((tower) => tower.isGhost === false)).toBe(true);
145146
expect(towers[0].isGhost).toBe(false);
146147
expect(towers[0].h).toBe(0); // 0 count non-ghost = 0 height
147148
expect(towers[0].strokeOpacity).toBe(0);

0 commit comments

Comments
 (0)