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

typography.test.ts

23 lines811 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 compact mobile font scale", () => {
7 expect(Object.values(MOBILE_TYPOGRAPHY).map(({ fontSize }) => fontSize)).toEqual([
8 10, 11, 12, 13, 14, 15, 17, 20, 24, 28,
9 ]);
10 });
11​
12 it("uses a compact shared style for editable composer text", () => {
13 expect(MOBILE_TYPOGRAPHY.composer).toEqual({ fontSize: 14, lineHeight: 20 });
14 });
15​
16 it("uses caption-sized code with a compact readable row height", () => {
17 expect(MOBILE_CODE_SURFACE).toMatchObject({
18 fontSize: MOBILE_TYPOGRAPHY.caption.fontSize,
19 lineNumberFontSize: MOBILE_TYPOGRAPHY.micro.fontSize,
20 rowHeight: 20,
21 });
22 });
23});