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

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

[
  'source === "riskModelPeople"',
  "当前命中模型",
  "dialogData.sourceSummary",
  "project-analysis-header__meta",
  "project-analysis-header__meta-label",
  "project-analysis-header__meta-value",
].forEach((token) => assert(dialog.includes(token), token));

[
  'class="source-summary"',
  "source-summary__label",
  "source-summary__value",
].forEach((token) => assert(!dialog.includes(token), token));

[
  "sourceSummary",
  "showCurrentModel: source === \"riskModelPeople\"",
  "currentModelLabel: \"当前命中模型\"",
].forEach((token) => assert(mockSource.includes(token), token));
