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

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

assert(source.includes("handleQuery"), "缺少查询提交方法");
assert(source.includes("resetQuery"), "缺少查询重置方法");
assert(source.includes("this.$message.error"), "查询失败时应提示错误");
assert(source.includes("state.rows = []"), "查询失败时应清空当前主题 rows");
assert(source.includes("state.total = 0"), "查询失败时应清空当前主题 total");
assert(source.includes("projectId()"), "应监听 projectId 变化");
assert(source.includes("resetAllStates"), "projectId 变化时应重置三类主题状态");
assert(source.includes("detailVisible"), "projectId 变化时应清空详情状态");
