import { describe, expect, it } from "vitest";
import { validateWorkshopEvidenceSync } from "@/lib/talleres/validation";

describe("talleres evidence validation", () => {
  it("rejects very small files", () => {
    const result = validateWorkshopEvidenceSync({
      fileName: "evidencia.pdf",
      mimeType: "application/pdf",
      sizeBytes: 1024,
    });

    expect(result.status).toBe("REJECTED");
  });

  it("approves structured documents", () => {
    const result = validateWorkshopEvidenceSync({
      fileName: "evidencia-final.pdf",
      mimeType: "application/pdf",
      sizeBytes: 150_000,
    });

    expect(result.status).toBe("APPROVED");
    expect(result.confidence).toBeGreaterThan(0.8);
  });

  it("rejects draft files", () => {
    const result = validateWorkshopEvidenceSync({
      fileName: "borrador-actividad.docx",
      mimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
      sizeBytes: 180_000,
    });

    expect(result.status).toBe("REJECTED");
  });
});
