Files
kandev/apps/web/components/settings/settings-typography.test.ts
T
2026-09-10 18:14:05 +01:00

28 lines
1.3 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { SETTINGS_TYPOGRAPHY } from "./settings-typography";
import { settingsActionClassName, settingsControlClassName } from "./settings-control";
describe("settings typography contract", () => {
it("defines one role scale for page, section, card, and field copy", () => {
expect(SETTINGS_TYPOGRAPHY.pageTitle).toContain("text-2xl");
expect(SETTINGS_TYPOGRAPHY.sectionTitle).toContain("text-lg");
expect(SETTINGS_TYPOGRAPHY.cardTitle).toContain("text-base");
expect(SETTINGS_TYPOGRAPHY.fieldLabel).toContain("text-xs");
expect(SETTINGS_TYPOGRAPHY.fieldDescription).toContain("text-xs/relaxed");
expect(SETTINGS_TYPOGRAPHY.error).toContain("text-sm/relaxed");
});
it("uses the md breakpoint for compact desktop settings controls", () => {
expect(SETTINGS_TYPOGRAPHY.control).toBe("text-sm md:text-xs");
expect(SETTINGS_TYPOGRAPHY.mobileAction).toBe("text-sm md:text-xs");
});
it("gives editable controls and actions a mobile hitbox", () => {
expect(settingsControlClassName()).toContain("h-7");
expect(settingsControlClassName()).toContain("max-md:h-11");
expect(settingsControlClassName()).toContain("md:text-xs");
expect(settingsActionClassName()).toContain("[@media(pointer:coarse)]:h-11");
});
});