import { describe, expect, it } from "vitest";

import { getLabDocument, getLabSummaries } from "~/lib/labs";

describe("labs discovery", () => {
  it("returns the renumbered labs in order including the new Lab 5", () => {
    const labs = getLabSummaries();

    expect(labs.map((lab) => lab.slug)).toEqual([
      "lab-1-visualization-in-transformerlab",
      "lab-2-quantization-tradeoffs",
      "lab-3-llama-cpp-and-ollama",
      "lab-4-oi-prompting",
      "lab-5-api-and-harnesses",
      "lab-6-embedding-and-chunking",
      "lab-7-dataset-generation-and-fine-tuning",
      "lab-8-evaluation-and-red-teaming",
    ]);
  });

  it("resolves the new Lab 5 document", () => {
    const lab = getLabDocument("lab-5-api-and-harnesses");

    expect(lab).not.toBeNull();
    expect(lab?.title).toBe("Lab 5 - API & Harnesses");
    expect(lab?.fileName).toBe("lab-5-api-and-harnesses.md");
  });
});
