Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

typography.test.ts

20 lines741 Bytes

1import { describe, expect, it } from "vite-plus/test";
2​
3import { MOBILE_CODE_SURFACE, MOBILE_TYPOGRAPHY } from "./typography";
4​
5describe("mobile typography", () => {
6 it("uses the intentional mobile font scale anchored at a 16pt body", () => {
7 expect(Object.values(MOBILE_TYPOGRAPHY).map(({ fontSize }) => fontSize)).toEqual([
8 11, 12, 13, 14, 16, 18, 21, 26, 30,
9 ]);
10 expect(MOBILE_TYPOGRAPHY.body).toEqual({ fontSize: 16, lineHeight: 23 });
11 });
12​
13 it("uses caption-sized code with a compact readable row height", () => {
14 expect(MOBILE_CODE_SURFACE).toMatchObject({
15 fontSize: MOBILE_TYPOGRAPHY.caption.fontSize,
16 lineNumberFontSize: MOBILE_TYPOGRAPHY.micro.fontSize,
17 rowHeight: 22,
18 });
19 });
20});