import { describe, expect, it } from "vitest";
import { routes } from "./routes";

describe("routes", () => {
  it("includes the production industry pages in sitemap routes", () => {
    [
      "/distribution",
      "/tertiaire",
      "/collectivité",
      "/industries/agricole",
      "/industries/erp",
    ].forEach((path) => {
      expect(routes).toContainEqual({
        path,
        changefreq: "monthly",
        priority: 0.85,
      });
    });
  });

  it("includes the production product pages in sitemap routes", () => {
    [
      "/nos-solutions-cool-roof",
      "/peinture-reflective-covatherm",
      "/laque-solaire-covatherm-light",
      "/covaseal",
      "/covametal",
    ].forEach((path) => {
      expect(routes).toContainEqual({
        path,
        changefreq: "monthly",
        priority: 0.9,
      });
    });
  });

  it("includes the roof type pages in sitemap routes", () => {
    [
      { path: "/toitures/membrane-bitumineuse", priority: 0.85 },
      { path: "/toitures/bac-acier", priority: 0.85 },
      { path: "/toitures/toiture-plate", priority: 0.82 },
      { path: "/toitures/fibrociment", priority: 0.8 },
      { path: "/toitures/tuiles-ciment", priority: 0.75 },
    ].forEach(({ path, priority }) => {
      expect(routes).toContainEqual({
        path,
        changefreq: "monthly",
        priority,
      });
    });
  });

  it("includes the applicator recruitment page in sitemap routes", () => {
    expect(routes).toContainEqual({
      path: "/devenir-applicateur",
      changefreq: "monthly",
      priority: 0.8,
    });
  });

  it("includes the about page in sitemap routes", () => {
    expect(routes).toContainEqual({
      path: "/qui-sommes-nous",
      changefreq: "monthly",
      priority: 0.7,
    });
  });

  it("includes the BAT-EN-112 CEE page in sitemap routes", () => {
    expect(routes).toContainEqual({
      path: "/bat-en-112",
      changefreq: "monthly",
      priority: 0.85,
    });
  });

  it("includes the contact page in sitemap routes", () => {
    expect(routes).toContainEqual({
      path: "/contact",
      changefreq: "monthly",
      priority: 0.7,
    });
  });

  it("includes the guides page in sitemap routes", () => {
    expect(routes).toContainEqual({
      path: "/guides",
      changefreq: "weekly",
      priority: 0.75,
    });
  });

  it("includes the production editorial hubs in sitemap routes", () => {
    [
      "/hub/aides-obligations",
      "/hub/chaleur-travail",
      "/hub/etancheite",
      "/hub/isolation",
      "/hub/peintures",
    ].forEach((path) => {
      expect(routes).toContainEqual({
        path,
        changefreq: "monthly",
        priority: 0.7,
      });
    });
  });

  it("includes the resource and references pages in sitemap routes", () => {
    [
      { path: "/guide-cool-roof", priority: 0.75 },
      { path: "/simulateur-economie-energie", priority: 0.75 },
      { path: "/faq", priority: 0.7 },
      { path: "/references", priority: 0.7 },
      { path: "/cool-roof-roche-bobois", priority: 0.65 },
      { path: "/presse", priority: 0.6 },
    ].forEach(({ path, priority }) => {
      expect(routes).toContainEqual({
        path,
        changefreq: "monthly",
        priority,
      });
    });
  });

  it("includes the legal page in sitemap routes", () => {
    expect(routes).toContainEqual({
      path: "/mentions-legales",
      changefreq: "yearly",
      priority: 0.4,
    });
  });
});
