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");

[
  "detailDialogVisible",
  "detailForm",
  "负债信息",
  "负面信息",
  "civilCnt",
  "enforceCnt",
  "admCnt",
  "handleDetail",
  "handleDelete",
  "deleteCreditInfo",
  "确认删除该征信对象当前已维护的征信信息吗？",
].forEach((token) => {
  assert(source.includes(token), `详情或删除交互缺少关键结构: ${token}`);
});

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