diff --git a/tests/theme.test.ts b/tests/theme.test.ts new file mode 100644 index 0000000..e3e5754 --- /dev/null +++ b/tests/theme.test.ts @@ -0,0 +1,24 @@ +import { describe, expect, it } from "vitest"; +import { autonomyColor, theme } from "../src/tui/lib/theme.js"; + +describe("theme", () => { + describe("autonomyColor", () => { + it('returns theme.down for "auto"', () => { + expect(autonomyColor("auto")).toBe(theme.down); + }); + + it('returns theme.flat for "confirm"', () => { + expect(autonomyColor("confirm")).toBe(theme.flat); + }); + + it('returns theme.up for "off"', () => { + expect(autonomyColor("off")).toBe(theme.up); + }); + + it('returns theme.up for any other string', () => { + expect(autonomyColor("unknown")).toBe(theme.up); + expect(autonomyColor("manual")).toBe(theme.up); + expect(autonomyColor("")).toBe(theme.up); + }); + }); +});