import { describe, expect, it } from "vitest";
import fs from "node:fs";
import path from "node:path";

const ASSET_CONTEXT_MENU_SOURCE = path.join(process.cwd(), "src/components/sidebar/asset-context-menu.tsx");

describe("asset context menu source", () => {
  it("删除按钮应把删除语义交给外层，而不是在菜单内硬编码单项 asset id", () => {
    const source = fs.readFileSync(ASSET_CONTEXT_MENU_SOURCE, "utf8");

    expect(source).toContain("onDelete: () => void;");
    expect(source).toContain("onClick={() => onDelete()}");
    expect(source).not.toContain("onDelete: (assetIds: string[]) => void;");
    expect(source).not.toContain("onClick={() => onDelete([asset.id])}");
  });
});
