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

describe("appRouter composition", () => {
  it("exposes auth, blog, marketingPages, navigation, media routers", () => {
    const procedures = appRouter._def.procedures;
    const keys = Object.keys(procedures);
    expect(keys.some((k) => k.startsWith("auth."))).toBe(true);
    expect(keys.some((k) => k.startsWith("blog."))).toBe(true);
    expect(keys.some((k) => k.startsWith("marketingPages."))).toBe(true);
    expect(keys.some((k) => k.startsWith("navigation."))).toBe(true);
    expect(keys.some((k) => k.startsWith("media."))).toBe(true);
  });

  it("blog router has expected procedures", () => {
    const procedures = appRouter._def.procedures;
    expect(procedures).toHaveProperty("blog.articleBySlug");
    expect(procedures).toHaveProperty("blog.listArticles");
  });
});
