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

const preliminaryCheckSource = 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"
);

[
  "getOverviewRiskModelCards",
  "riskModelCardsRes",
  "riskModelCardsData",
  "Promise.all",
  "pageState === 'loading'",
  "pageState === 'empty'",
  'hasOverviewData ? "loaded" : "empty"',
].forEach((token) => assert(preliminaryCheckSource.includes(token), token));

[
  "warningTypeOptions",
  'model: "large"',
].forEach((token) => assert(!mockSource.includes(token), token));
