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

[
  "formatQueryDate(value)",
  "const matched = value.match(/^(",
  'this.parseTime(value, "{y}-{m}-{d}")',
  "{{ formatQueryDate(scope.row.queryDate) }}",
  "{{ formatQueryDate(detailForm.queryDate) }}",
].forEach((token) => {
  assert(source.includes(token), `征信时间展示缺少关键实现: ${token}`);
});

console.log("credit-info-date-display test passed");
