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

appearancePreferences.test.ts

22 lines893 Bytes

1import { describe, expect, it } from "vite-plus/test";
2​
3import { resolveAppearancePreferences, resolveComposerTextRole } from "./appearancePreferences";
4​
5describe("appearancePreferences", () => {
6 it("migrates the legacy markdownFontSize key to baseFontSize", () => {
7 expect(resolveAppearancePreferences({ markdownFontSize: 18 }).baseFontSize).toBe(18);
8 expect(
9 resolveAppearancePreferences({ baseFontSize: 16, markdownFontSize: 18 }).baseFontSize,
10 ).toBe(16);
11 });
12​
13 it("scales the iOS composer text with the system text size", () => {
14 const body = { fontSize: 16, lineHeight: 23 };
15 expect(resolveComposerTextRole(body, 1, "ios")).toEqual(body);
16 expect(resolveComposerTextRole(body, 2.643, "ios")).toEqual({
17 fontSize: 16 * 2.643,
18 lineHeight: 23 * 2.643,
19 });
20 expect(resolveComposerTextRole(body, 2.643, "android")).toEqual(body);
21 });
22});