import type { WagtailCircle } from "@/types";
import { describe, it } from "vitest";
import { Circle } from "../circle";
import data from "./learning_path_json.json";

describe("Circle.parseJson", () => {
  it("can parse circle from api response", () => {
    const cirleData = data.children.find(
      (c) => c.slug === "test-lehrgang-lp-circle-fahrzeug"
    ) as unknown as WagtailCircle;
    const circle = Circle.fromJson(cirleData, undefined);
    expect(circle.learningSequences.length).toBe(3);
    expect(circle.flatLearningContents.length).toBe(9);
  });
});
