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

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

[
  "uploadDialogVisible",
  "uploadFileList",
  "批量上传征信HTML",
  "仅支持 .html / .htm 文件",
  "上传结果",
  "failureList",
  "successCount",
  "failureCount",
  "handleUploadSubmit",
  "beforeUpload",
  "uploadCreditHtml",
].forEach((token) => {
  assert(source.includes(token), `征信上传交互缺少关键结构: ${token}`);
});

console.log("credit-info-upload-ui test passed");
