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

const componentPath = path.resolve(
  __dirname,
  "../../src/views/ccdiProject/components/detail/UploadData.vue"
);
const actionRulePath = path.resolve(
  __dirname,
  "../../src/views/ccdiProject/components/detail/uploadFileActionRules.js"
);
const source = fs.readFileSync(componentPath, "utf8");
const actionRuleSource = fs.readFileSync(actionRulePath, "utf8");

assert(
  /删除[^"]*重新打标[^"]*是否继续/.test(source),
  "删除确认框应明确提示即将重新打标"
);

assert(
  /删除成功，已开始项目重新打标/.test(source),
  "删除成功提示应明确告知已开始项目重新打标"
);

assert(actionRuleSource.includes("HISTORY_IMPORT"), "上传记录操作规则应识别历史导入来源");

console.log("upload-data-delete-retag-copy test passed");
