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 source = fs.readFileSync(componentPath, "utf8");

const dialogIndex = source.indexOf('title="拉取本行信息"');
assert.notStrictEqual(dialogIndex, -1, "未找到拉取本行信息弹窗");

const dialogEndIndex = source.indexOf("</el-dialog>", dialogIndex);
assert.notStrictEqual(dialogEndIndex, -1, "未找到拉取本行信息弹窗结束标签");

const dialogSource = source.slice(dialogIndex, dialogEndIndex);

assert(
  /class="pull-bank-info-form"/.test(dialogSource),
  "拉取本行信息弹窗应使用独立表单容器，便于控制排版"
);

assert(
  /class="pull-bank-file-panel"/.test(dialogSource),
  "拉取本行信息弹窗应提供独立的文件导入面板"
);

assert(
  /class="pull-bank-file-upload"/.test(dialogSource),
  "文件选择区域应有独立样式钩子，避免点击范围铺满整行"
);

assert(
  /class="selected-id-card-file"/.test(dialogSource),
  "选择文件后应显示已选文件摘要区域"
);

console.log("upload-data-pull-bank-info-dialog-layout test passed");
