lookingglass/hyperglass/ui/util/theme.test.ts
2024-02-27 17:44:19 -05:00

15 lines
554 B
TypeScript

import { googleFontUrl } from './theme';
import { describe, expect, test } from 'vitest';
describe('google font URL generation', () => {
test('no space font', () => {
const result = googleFontUrl('Inter', [100, 200, 300]);
expect(result).toBe('https://fonts.googleapis.com/css?family=Inter:100,200,300&display=swap');
});
test('space font', () => {
const result = googleFontUrl('Open Sans', [100, 200, 300]);
expect(result).toBe(
'https://fonts.googleapis.com/css?family=Open+Sans:100,200,300&display=swap',
);
});
});