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

const componentPath = path.resolve(
  __dirname,
  "../../src/views/ccdiProject/components/detail/DetailQuery.vue"
);
const source = fs.readFileSync(componentPath, "utf8");

assert(source.includes('label="异常标签"'), "列表应新增异常标签列");
assert(source.includes("scope.row.hitTags"), "异常标签列应读取当前行的 hitTags");
assert(
  source.includes('v-for="(tag, index) in scope.row.hitTags"'),
  "异常标签列应逐个渲染命中标签"
);
assert(source.includes("tag.ruleName"), "异常标签列应展示标签名称");

console.log("detail-query-hit-tags-list test passed");
