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

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

[
  "getOverviewRiskPeople({",
  "projectId: this.projectId",
  "pageNum: 1",
  "pageSize: 5",
  "riskPeopleData.rows",
].forEach((token) => assert(source.includes(token), token));

[
  "rows",
  "total",
  "pageNum",
  "pageSize",
].forEach((token) => assert(mockSource.includes(token), `riskPeople 应保存 ${token}`));
