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

const pagePath = path.resolve(
  __dirname,
  "../../src/views/ccdiIntermediary/index.vue"
);
const source = fs.readFileSync(pagePath, "utf8");

[
  "ccdi_intermediary_person_import_task",
  "ccdi_intermediary_enterprise_relation_import_task",
  "personFailureDialogVisible",
  "enterpriseRelationFailureDialogVisible",
  "personFailureList",
  "enterpriseRelationFailureList",
  "getPersonImportFailures",
  "getEnterpriseRelationImportFailures",
  "getPersonImportStatus",
  "getEnterpriseRelationImportStatus",
  "refreshCurrentDetail()",
  "restoreImportTasks()"
].forEach((token) => {
  assert(source.includes(token), `中介导入页面缺少任务恢复或失败记录状态: ${token}`);
});

console.log("intermediary-import-state test passed");
