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

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

["风险模型", "命中模型涉及人员", "员工姓名或工号", "异常标签"].forEach((token) =>
  assert(model.includes(token), token)
);
["<el-radio-button label=\"ANY\">任意触发</el-radio-button>", "<el-radio-button label=\"ALL\">同时触发</el-radio-button>"].forEach(
  (token) => assert(model.includes(token), token)
);
["部门", "请选择部门", "查询", "重置", "selectedModelText"].forEach((token) =>
  assert(model.includes(token), token)
);
[
  "风险明细",
  "涉疑交易明细",
  "异常账户人员信息",
  "账号",
  "开户人",
  "银行",
  "异常类型",
  "异常发生时间",
  "状态",
].forEach((token) =>
  assert(detail.includes(token), token)
);
["getOverviewSuspiciousTransactions", "riskDetails"].forEach((token) =>
  assert(preliminaryCheck.includes(token), token)
);
