Deploy Canina / deploy (push) Successful in 2m10s
- SEO-P1-07: extract FAQs and accordion items from blog content and inject JSON-LD FAQPage schema - SEO-P1-10: add dynamic sub-sitemaps /sitemap-blog.xml and /sitemap-wiki.xml and register in robots.ts - SEO-P2-16: host Lalezar font locally as optimized WOFF2 with preload enabled in lib/fonts.ts - Add full regression test suites with 100% pass rate
30 lines
1.0 KiB
TypeScript
30 lines
1.0 KiB
TypeScript
import { describe, it, expect, vi } from 'vitest';
|
|
|
|
vi.mock('next/font/local', () => ({
|
|
default: vi.fn((opts) => ({
|
|
variable: opts.variable,
|
|
className: 'mock-font',
|
|
src: opts.src,
|
|
preload: opts.preload,
|
|
display: opts.display,
|
|
})),
|
|
}));
|
|
|
|
describe('Local font configuration and preloading (SEO-P2-16)', () => {
|
|
it('configures Lalezar as a local font with WOFF2 and preload enabled', async () => {
|
|
const { lalezar } = await import('../fonts');
|
|
expect(lalezar).toBeDefined();
|
|
expect(lalezar.variable).toBe('--font-lalezar');
|
|
expect((lalezar as any).preload).toBe(true);
|
|
expect((lalezar as any).display).toBe('swap');
|
|
expect((lalezar as any).src[0].path).toContain('Lalezar-Regular.woff2');
|
|
});
|
|
|
|
it('configures Vazirmatn as a local font with preload enabled', async () => {
|
|
const { vazirmatn } = await import('../fonts');
|
|
expect(vazirmatn).toBeDefined();
|
|
expect(vazirmatn.variable).toBe('--font-vazir');
|
|
expect((vazirmatn as any).preload).toBe(true);
|
|
});
|
|
});
|