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

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

assert(fs.existsSync(componentPath), "未找到征信维护页面 index.vue");

const source = fs.readFileSync(componentPath, "utf8");

[
  'name: "CcdiCreditInfo"',
  "app-container",
  "姓名",
  "身份证号",
  "批量上传征信HTML",
  "最近征信查询日期",
  "负债笔数",
  "负债总额",
  "民事案件笔数",
  "强制执行笔数",
  "行政处罚笔数",
  "详情",
  "删除",
].forEach((token) => {
  assert(source.includes(token), `征信维护页面缺少关键结构: ${token}`);
});

assert(!source.includes('label="柜员号"'), "征信维护页面不应再展示柜员号查询项");
assert(!source.includes('prop="staffId"'), "征信维护列表不应再展示柜员号列");

console.log("credit-info-page-layout test passed");
