Skip to content

Commit d20a1e7

Browse files
committed
test(generatorConstants): create generatorConstants tests
1 parent 87014f5 commit d20a1e7

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

lib/svg/generatorConstants.test.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { describe, it, expect } from 'vitest';
2+
import { SVG_WIDTH, SVG_HEIGHT, FONT_MAP, isFontKey } from './generatorConstants';
3+
4+
describe('generatorConstants', () => {
5+
it('SVG_WIDTH equals 600', () => {
6+
expect(SVG_WIDTH).toBe(600);
7+
});
8+
9+
it('SVG_HEIGHT equals 420', () => {
10+
expect(SVG_HEIGHT).toBe(420);
11+
});
12+
13+
it('FONT_MAP jetbrains contains JetBrains Mono', () => {
14+
expect(FONT_MAP.jetbrains).toContain('JetBrains Mono');
15+
});
16+
17+
it('FONT_MAP fira contains Fira Code', () => {
18+
expect(FONT_MAP.fira).toContain('Fira Code');
19+
});
20+
21+
it('FONT_MAP roboto contains Roboto', () => {
22+
expect(FONT_MAP.roboto).toContain('Roboto');
23+
});
24+
25+
it('isFontKey returns true for jetbrains', () => {
26+
expect(isFontKey('jetbrains')).toBe(true);
27+
});
28+
29+
it('isFontKey returns true for roboto', () => {
30+
expect(isFontKey('roboto')).toBe(true);
31+
});
32+
33+
it('isFontKey returns false for unknown-font', () => {
34+
expect(isFontKey('unknown-font')).toBe(false);
35+
});
36+
37+
it('isFontKey returns false for empty string', () => {
38+
expect(isFontKey('')).toBe(false);
39+
});
40+
});

0 commit comments

Comments
 (0)