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

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

[
  "sectionData.rows",
  "normalizeOverviewRows",
  "normalizeRiskPointTags",
  "riskCount",
  "riskPoint",
  "modelCount",
  "pageNum",
  "pageSize",
  "total",
  "riskLevelType",
  '@click="handleRiskPeopleExport"',
].forEach((token) => assert(source.includes(token), token));

assert(!source.includes("sectionData.topRiskList"), "不应再绑定TOP10列表");
assert(!source.includes("sectionData.overviewList"), "风险人员列表不应再绑定 overviewList");

assert(!source.includes("scope.row.riskLevelType || 'danger'"), "riskLevelType fallback");
assert(source.includes('scope.row.actionLabel || "查看详情"'), "actionLabel fallback");
assert(source.includes("return [];"), "overviewList 缺省时应回落为空数组");
assert(source.includes(".split(/[、,，;；]/)"), "核心异常点字符串应支持拆分为标签");
