import { describe, expect, test } from "bun:test";

import { checkerRegistry } from "../../../../../src/server/checker/runner";

describe("LLM registry integration", () => {
  test("registry 包含 llm 类型", () => {
    expect(checkerRegistry.supportedTypes).toContain("llm");
  });

  test("llm checker 可获取", () => {
    const checker = checkerRegistry.tryGet("llm");
    expect(checker).toBeDefined();
    expect(checker!.type).toBe("llm");
    expect(checker!.configKey).toBe("llm");
  });

  test("llm checker schemas 有效", () => {
    const checker = checkerRegistry.get("llm");
    expect(checker.schemas.config).toBeDefined();
    expect(checker.schemas.defaults).toBeDefined();
    expect(checker.schemas.expect).toBeDefined();
  });

  test("llm checker validate 方法可用", () => {
    const checker = checkerRegistry.get("llm");
    const issues = checker.validate({
      defaults: {},
      targets: [],
    });
    expect(issues).toHaveLength(0);
  });
});
