chore: move getPretextFontString into separate directory

This commit is contained in:
Ilia Mashkov
2026-05-23 20:03:13 +03:00
parent f3c4e72b86
commit 95ae72719e
3 changed files with 1 additions and 1 deletions
@@ -0,0 +1,35 @@
import {
describe,
expect,
it,
} from 'vitest';
import { getPretextFontString } from './getPretextFontString';
describe('getPretextFontString', () => {
it('correctly formats the font string for pretext', () => {
const weight = 400;
const sizePx = 16;
const fontName = 'Inter';
const expected = '400 16px "Inter"';
expect(getPretextFontString(weight, sizePx, fontName)).toBe(expected);
});
it('works with different weight and size', () => {
const weight = 700;
const sizePx = 32;
const fontName = 'Roboto';
const expected = '700 32px "Roboto"';
expect(getPretextFontString(weight, sizePx, fontName)).toBe(expected);
});
it('handles font names with spaces', () => {
const weight = 400;
const sizePx = 16;
const fontName = 'Open Sans';
const expected = '400 16px "Open Sans"';
expect(getPretextFontString(weight, sizePx, fontName)).toBe(expected);
});
});