Files
kandev/apps/web/components/settings/terminal-settings.test.ts
T
2026-06-15 21:13:04 +01:00

16 lines
611 B
TypeScript

import { describe, expect, it } from "vitest";
import { normalizeTerminalFontSize } from "./terminal-settings";
describe("normalizeTerminalFontSize", () => {
it("clamps finite font sizes to the supported range", () => {
expect(normalizeTerminalFontSize(6, 13)).toBe(8);
expect(normalizeTerminalFontSize(18, 13)).toBe(18);
expect(normalizeTerminalFontSize(30, 13)).toBe(24);
});
it("uses the fallback when the input is not finite", () => {
expect(normalizeTerminalFontSize(Number.NaN, 15)).toBe(15);
expect(normalizeTerminalFontSize(Number.POSITIVE_INFINITY, 15)).toBe(15);
});
});