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

const overviewSource = fs.readFileSync(
  path.resolve(
    __dirname,
    "../../src/views/ccdiProject/components/detail/OverviewStats.vue"
  ),
  "utf8"
);
const mockSource = fs.readFileSync(
  path.resolve(
    __dirname,
    "../../src/views/ccdiProject/components/detail/preliminaryCheck.mock.js"
  ),
  "utf8"
);

assert(overviewSource.includes(".stats-card"), "缺少风险总览统计卡样式");
assert(overviewSource.includes("box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);"), "风险总览统计卡应添加阴影");
assert(overviewSource.includes("item.icon"), "风险总览统计卡应展示小图标");
assert(overviewSource.includes("item.label"), "风险总览统计卡应展示标题");
assert(mockSource.includes('label: "无预警人数"'), "风险总览最后一个指标应改为无预警人数");
assert(!mockSource.includes('label: "无风险人员"'), "无风险人员文案应被替换");
