-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlayout.test.ts
More file actions
26 lines (22 loc) · 1.14 KB
/
Copy pathlayout.test.ts
File metadata and controls
26 lines (22 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import fs from 'node:fs';
import path from 'node:path';
import { describe, expect, it } from 'vitest';
const layoutPath = path.resolve(process.cwd(), 'app/layout.tsx');
const layoutContent = fs.readFileSync(layoutPath, 'utf8');
const tossfacePath = path.resolve(process.cwd(), 'styles/tossface.css');
const tossfaceContent = fs.readFileSync(tossfacePath, 'utf8');
describe('root layout font loading', () => {
it('preloads the primary text font without eagerly loading Tossface', () => {
expect(layoutContent).toContain('href="/fonts/PretendardVariable.woff2"');
expect(layoutContent).not.toContain('href="/fonts/TossFaceFontWeb.otf"');
});
it('passes a public client DTO instead of full editorial metadata', () => {
expect(layoutContent).toContain('selectClientPosts(getSortedFeedData())');
expect(layoutContent).toContain('<AppProviders posts={posts}>');
});
it('keeps Tossface demand-driven for matching emoji glyphs', () => {
expect(layoutContent).toContain("import '@/styles/tossface.css';");
expect(tossfaceContent).toContain("font-family: 'Tossface Safe';");
expect(tossfaceContent).toContain('unicode-range:');
});
});