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

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

[
  "currentProjectAnalysisPerson",
  "projectAnalysisSource",
  "projectAnalysisModelSummary",
  "openProjectAnalysisDialog(source, person)",
  'this.projectAnalysisSource = source || "riskPeople"',
  "this.currentProjectAnalysisPerson = person || null",
  "this.projectAnalysisModelSummary = this.buildProjectAnalysisModelSummary",
  "this.projectAnalysisDialogVisible = true",
  'this.openProjectAnalysisDialog("riskPeople", row)',
  'this.openProjectAnalysisDialog("riskModelPeople", row)',
  'projectAnalysisSource: "riskPeople"',
].forEach((token) => assert(entry.includes(token), token));

[
  ':person="currentProjectAnalysisPerson"',
  ':source="projectAnalysisSource"',
  ':model-summary="projectAnalysisModelSummary"',
  "@close=\"handleProjectAnalysisDialogClose\"",
].forEach((token) => assert(entry.includes(token), token));

[
  "buildProjectAnalysisModelSummary(source, person)",
  "staffIdCard",
].forEach((token) => assert(entry.includes(token), token));
