import { describe, expect, it } from "vitest";
import {
  getStatusActivity,
  getStatusTone,
  getWorkOrderStageActivity,
  getWorkOrderStageTone
} from "./scheduled-condition-feed-utils";

describe("scheduled condition status presentation", () => {
  it("maps lifecycle states to the shared semantic language", () => {
    expect({
      pending: getStatusTone("pending"),
      running: getStatusTone("running"),
      awaitingReply: getStatusTone("awaiting_reply"),
      completed: getStatusTone("completed"),
      warning: getStatusTone("warning"),
      error: getStatusTone("error")
    }).toEqual({
      pending: "neutral",
      running: "info",
      awaitingReply: "warning",
      completed: "success",
      warning: "warning",
      error: "danger"
    });
    expect(getStatusActivity("running")).toBe("loading");
    expect(getStatusActivity("awaiting_reply")).toBe("static");
  });

  it("keeps work-order dispatch, execution, and reply visually distinct", () => {
    expect({
      dispatch: getWorkOrderStageTone("dispatch"),
      execution: getWorkOrderStageTone("execution"),
      reply: getWorkOrderStageTone("reply")
    }).toEqual({
      dispatch: "neutral",
      execution: "info",
      reply: "warning"
    });
    expect(getWorkOrderStageActivity("execution")).toBe("loading");
  });
});
