const assert = require("assert");
const fs = require("fs");
const path = require("path");

const specialCheckSource = fs.readFileSync(
  path.resolve(__dirname, "../../src/views/ccdiProject/components/detail/SpecialCheck.vue"),
  "utf8"
);
const sectionSource = fs.readFileSync(
  path.resolve(__dirname, "../../src/views/ccdiProject/components/detail/ExtendedQuerySection.vue"),
  "utf8"
);

assert(specialCheckSource.includes("extended-query-section"), "专项核查主容器缺少拓展查询组件");
assert(specialCheckSource.includes(':project-id="projectId"'), "专项核查主容器未透传 projectId");
assert(
  specialCheckSource.includes('<div v-if="projectId" class="special-check-extended-wrapper">'),
  "拓展查询卡片应在 projectId 有效时独立渲染"
);
assert(sectionSource.includes("拓展查询"), "拓展查询组件缺少标题");
assert(sectionSource.includes("采购记录"), "拓展查询组件缺少采购记录 Tab");
assert(sectionSource.includes("招聘记录"), "拓展查询组件缺少招聘记录 Tab");
assert(sectionSource.includes("调动记录"), "拓展查询组件缺少调动记录 Tab");
assert(sectionSource.includes("required: true"), "拓展查询组件的 projectId 应为必传 props");
