import { describe, it, expect, vi } from "vitest";
import { runImageRedactor } from "./run";
import type { ToolContext } from "../../core/plugins/plugin-types";

describe("Image Redactor Plugin", () => {
  const mockContext: ToolContext = {
    signal: new AbortController().signal,
    reportProgress: vi.fn(),
    logger: {
      info: vi.fn(),
      warn: vi.fn(),
      error: vi.fn(),
    },
  };

  it("should throw error if no files provided", async () => {
    await expect(
      runImageRedactor(
        { files: [] },
        { rects: [], color: "#000000" },
        mockContext
      )
    ).rejects.toThrow("No image file uploaded.");
  });
});
