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

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

[
  'sidebarData.basicInfo.name || "-"',
  'sidebarData.basicInfo.staffCode || "-"',
  'sidebarData.basicInfo.department || "-"',
  'sidebarData.basicInfo.projectName || "-"',
  'sidebarData.basicInfo.riskLevel || "-"',
  "暂无异常标签",
].forEach((token) => assert(sidebar.includes(token), token));

[
  "projectAnalysisTabs",
  'key: "abnormalDetail"',
].forEach((token) => assert(mockSource.includes(token), token));

[
  "detailData: null",
  "detailError = \"\"",
  "detailData = null",
].forEach((token) => assert(dialog.includes(token), token));
