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

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

[
  "模板包含“招聘信息”和“历史工作经历”两个 Sheet。",
  "this.currentTaskId = taskId",
  "this.showFailureButton = false",
  "this.startImportStatusPolling(taskId)"
].forEach((token) => {
  assert(source.includes(token), `招聘导入状态未统一到单任务: ${token}`);
});

[
  "currentImportType",
  "upload.importType",
  "getImportTypeLabel"
].forEach((token) => {
  assert(!source.includes(token), `招聘导入状态不应再按类型拆分: ${token}`);
});

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