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

describe("CMS app payload.config", () => {
  it("registers all feature collections", async () => {
    const resolved = await config;
    const slugs = resolved.collections?.map((c) => c.slug) ?? [];
    expect(slugs).toEqual(
      expect.arrayContaining(["users", "articles", "pages", "media"]),
    );
  });

  it("registers all feature globals", async () => {
    const resolved = await config;
    const slugs = resolved.globals?.map((g) => g.slug) ?? [];
    expect(slugs).toEqual(
      expect.arrayContaining(["site-settings", "header"]),
    );
  });
});
