import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import { dirname, join } from "node:path";
import test from "node:test";
import { fileURLToPath } from "node:url";

const testDirectory = dirname(fileURLToPath(import.meta.url));

test("dropdown shows the shared checkbox for the selected single value", () => {
  const source = readFileSync(join(testDirectory, "dropdown.tsx"), "utf8");

  assert.match(source, /import \{ AppCheckbox \} from "@\/components\/ui\/checkbox"/);
  assert.match(source, /const selectedValues = Array\.isArray\(value\) \? value : \[value\]/);
});
