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"
);

assert(
  preliminaryCheckSource.includes("getOverviewSuspiciousTransactions"),
  "结果总览应加载涉疑交易接口"
);
assert(
  preliminaryCheckSource.includes("riskDetails"),
  "结果总览应继续向 RiskDetailSection 注入 riskDetails"
);
assert(
  preliminaryCheckSource.includes("const DEFAULT_SUSPICIOUS_PAGE_SIZE = 10;") &&
    preliminaryCheckSource.includes("pageSize: DEFAULT_SUSPICIOUS_PAGE_SIZE"),
  "结果总览首屏涉疑交易应按10条加载"
);
assert(
  mockSource.includes("suspiciousTransactionList"),
  "mock 归一化应保留涉疑交易列表"
);
