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

function read(file) {
  return fs.readFileSync(
    path.resolve(
      __dirname,
      `../../src/views/ccdiProject/components/detail/${file}`
    ),
    "utf8"
  );
}

const overview = read("OverviewStats.vue");
const people = read("RiskPeopleSection.vue");
const model = read("RiskModelSection.vue");
const detail = read("RiskDetailSection.vue");
const entry = read("PreliminaryCheck.vue");

[
  [overview, ".stats-card", "border-radius: 0;"],
  [model, ".section-card", "border-radius: 0;"],
  [model, ".model-card", "border-radius: 0;"],
  [detail, ".section-card", "border-radius: 0;"],
  [entry, ".state-card", "border-radius: 0;"],
  [entry, ".risk-overview-card", "border-radius: 0;"],
].forEach(([source, selector, token]) => {
  assert(source.includes(selector), `缺少选择器: ${selector}`);
  assert(source.includes(token), `卡片应使用直角: ${selector}`);
});
