import { readFileSync } from "node:fs";
import { resolve } from "node:path";

const componentPath = resolve(process.cwd(), "src/components/DrawerDataTable.vue");
const source = readFileSync(componentPath, "utf8");

const requiredSnippets = [
  "defineProps",
  "columns",
  "rows",
  "rowKey",
  "expandedRows",
  "cellClass",
  "slot :name=\"`cell-${column.key}`\"",
  "drawer-data-table",
  "drawer-row-detail"
];

for (const snippet of requiredSnippets) {
  if (!source.includes(snippet)) {
    throw new Error(`DrawerDataTable missing required snippet: ${snippet}`);
  }
}

console.log("drawer data table static tests passed");
