import { test, expect } from "vitest";
import { describe, type Load } from "./App";
test("all variants have a meaningful representation", () => {
  expect(describe({ kind: "empty" }, String)).toBe("No vehicles");
  expect(describe({ kind: "idle" }, String)).toBe("Not loaded");
  expect(describe({ kind: "loading" }, String)).toBe("Loading");
  expect(
    describe({ kind: "ready", data: [1, 2] }, (rows) => rows.join(",")),
  ).toBe("1,2");
  expect(describe({ kind: "error", message: "Offline" }, String)).toBe(
    "Offline",
  );
});
// @ts-expect-error A ready state requires data.
const missing: Load<string> = { kind: "ready" };
void missing;
