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

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

assert(
  /if\s*\(row\.sourceType\s*===\s*["']HISTORY_IMPORT["']\)\s*\{\s*return null/.test(actionRuleSource),
  "历史导入文件应直接隐藏删除入口"
);

console.log("upload-data-history-import-readonly test passed");
