Skip to content

Commit 30e462f

Browse files
Combine SVG NaN/undefined value tests
Merged separate tests for NaN and undefined values in SVG output into a single test case. This improves test clarity and reduces redundancy by validating width, height, and general undefined checks together.
1 parent f735ab5 commit 30e462f

File tree

1 file changed

+4
-25
lines changed

1 file changed

+4
-25
lines changed

tests/svg-utils.test.ts

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ describe('createWrappedSponsorSvg', () => {
355355
expect(result).not.toContain('y="NaN"');
356356
});
357357

358-
it('should not produce NaN for width', () => {
358+
it('should not produce NaN or undefined values', () => {
359359
const result = createWrappedSponsorSvg(
360360
mockSponsor,
361361
simpleSvgContent,
@@ -366,38 +366,17 @@ describe('createWrappedSponsorSvg', () => {
366366
0
367367
);
368368

369+
// Width validation
369370
expect(result).toContain('width="60"');
370371
expect(result).not.toContain('width="NaN"');
371372
expect(result).not.toContain('width="undefined"');
372-
});
373-
374-
it('should not produce NaN for height', () => {
375-
const result = createWrappedSponsorSvg(
376-
mockSponsor,
377-
simpleSvgContent,
378-
180,
379-
180,
380-
60,
381-
0,
382-
0
383-
);
384373

374+
// Height validation
385375
expect(result).toContain('height="60"');
386376
expect(result).not.toContain('height="NaN"');
387377
expect(result).not.toContain('height="undefined"');
388-
});
389-
390-
it('should not produce undefined in viewBox', () => {
391-
const result = createWrappedSponsorSvg(
392-
mockSponsor,
393-
simpleSvgContent,
394-
180,
395-
180,
396-
60,
397-
0,
398-
0
399-
);
400378

379+
// General undefined check
401380
expect(result).not.toContain('undefined');
402381
});
403382
});

0 commit comments

Comments
 (0)