import { describe, it, expect } from "vitest";
import { GET } from "./route";

describe("GET /api/werkwijze", () => {
  it("geeft doel, uitgangspunten en een genummerd stappenplan terug", async () => {
    const res = await GET();
    expect(res.status).toBe(200);
    const json = await res.json();
    expect(typeof json.doel).toBe("string");
    expect(Array.isArray(json.uitgangspunten)).toBe(true);
    expect(Array.isArray(json.stappen)).toBe(true);
    expect(json.stappen.length).toBeGreaterThan(0);
    for (const stap of json.stappen) {
      expect(typeof stap.stap).toBe("number");
      expect(typeof stap.titel).toBe("string");
      expect(Array.isArray(stap.tools)).toBe(true);
      expect(stap.tools.length).toBeGreaterThan(0);
    }
  });
});
