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

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

assert(source.includes('activeTab: "purchase"'), "默认激活 Tab 应为采购记录");
assert(source.includes("handleTabChange"), "缺少 Tab 切换处理方法");
assert(source.includes("loadList"), "缺少列表加载方法");
assert(source.includes("if (!state.loaded)"), "首次切换到 Tab 时应按 loaded 状态触发首查");
assert(source.includes("purchase:"), "缺少采购 Tab 状态");
assert(source.includes("recruitment:"), "缺少招聘 Tab 状态");
assert(source.includes("transfer:"), "缺少调动 Tab 状态");
