From 18cce1b7b812f28bf4bc685f561aa8a491543d7e Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 11 Jun 2026 03:35:47 +0000 Subject: [PATCH] test: add tests for autonomyColor theme utility Co-authored-by: toreleon <42534763+toreleon@users.noreply.github.com> --- tests/theme.test.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/theme.test.ts 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); + }); + }); +});