Skip to content

Commit 1e7c688

Browse files
committed
test(utils): check boundary robustness of escapeXML helper (JhaSourav07#1558)
1 parent a4dcf09 commit 1e7c688

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
@@ -1211,6 +1211,10 @@ describe('escapeXML', () => {
12111211
it('escapes script injection characters <script>&" together', () => {
12121212
expect(escapeXML('<script>&"')).toBe('&lt;script&gt;&amp;&quot;');
12131213
});
1214+
1215+
it('should handle boundary input with only special XML characters', () => {
1216+
expect(escapeXML('<>&"\'')).toBe('&lt;&gt;&amp;&quot;&#39;');
1217+
});
12141218
});
12151219

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

0 commit comments

Comments
 (0)