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"
);
const preliminaryCheckSource = fs.readFileSync(
  path.resolve(
    __dirname,
    "../../src/views/ccdiProject/components/detail/PreliminaryCheck.vue"
  ),
  "utf8"
);

assert(!overviewSource.includes("section-actions"), "统计区不应继续保留旧操作区壳层");
assert(!mockSource.includes('label: "批量导出"'), "风险总览不应保留批量导出按钮");
assert(!mockSource.includes('label: "切换视图"'), "风险总览不应保留切换视图按钮");

[
  "handleOverviewReportExport",
  "ccdi/project/overview/report/export",
  "初核结果报告_",
  "一键导出",
].forEach((token) => assert(preliminaryCheckSource.includes(token), token));
