Skip to content

Commit 61f67f3

Browse files
authored
test(utils): check boundary robustness of escapeXML helper (JhaSourav07#1558) (JhaSourav07#2151)
## Description Fixes JhaSourav07#1558 ## Pillar - [ ] 🎨 Pillar 1 — New Theme Design - [ ] 📐 Pillar 2 — Geometric SVG Improvement - [ ] 🕐 Pillar 3 — Timezone Logic Optimization - [x] 🛠️ Other (Bug fix, refactoring, docs) ## Visual Preview ## 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. - [ ] The SVG output matches the CommitPulse "premium quality" aesthetic standard (no raw elements, smooth animations, correct fonts). - [ ] (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.
2 parents e6752cd + e892bc0 commit 61f67f3

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/svg/generator.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,6 +1236,10 @@ describe('escapeXML', () => {
12361236
it('escapes script injection characters <script>&" together', () => {
12371237
expect(escapeXML('<script>&"')).toBe('&lt;script&gt;&amp;&quot;');
12381238
});
1239+
1240+
it('should handle boundary input with only special XML characters', () => {
1241+
expect(escapeXML('<>&"\'')).toBe('&lt;&gt;&amp;&quot;&#39;');
1242+
});
12391243
});
12401244

12411245
describe('particleCount', () => {

0 commit comments

Comments
 (0)