import assert from "node:assert/strict";
import test from "node:test";

import { collectFooterStatusItems, FAST_MODE_STATUS_KEY } from "../status.ts";

test("renders enabled Codex Fast mode as an explicit accented segment", () => {
  const items = collectFooterStatusItems(new Map([[FAST_MODE_STATUS_KEY, "on"]]));

  assert.deepEqual(items, [{ text: "Fast on", accent: true }]);
});

test("hides disabled Codex Fast mode", () => {
  const items = collectFooterStatusItems(new Map([[FAST_MODE_STATUS_KEY, "off"]]));

  assert.deepEqual(items, []);
});

test("preserves other non-empty extension statuses", () => {
  const items = collectFooterStatusItems(new Map([
    ["one", "Ready"],
    ["empty", "  "],
    ["two", "2 tasks"],
  ]));

  assert.deepEqual(items, [
    { text: "Ready", accent: false },
    { text: "2 tasks", accent: false },
  ]);
});
