import { describe, it, expect } from "vitest"; import { type PageAttributes, resolvePageAttributes, resolveSiteAttributes, type SiteAttributes, } from "../site/attributes"; describe("Attributes test suite", () => { describe("resolvePageAttributes", () => { it("should resolve attributes with default values", () => { const attributes = { label: "Test Page", path: "/test", layout: "default", title: "Test", }; const result = resolvePageAttributes(attributes); // The function merges provided attributes with defaults // Since required fields were provided, it should return those fields expect(result.label).toBe("Test Page"); expect(result.path).toBe("/test"); expect(result.layout).toBe("default"); expect(result.title).toBe("Test"); }); }); describe("resolveSiteAttributes", () => { it("should resolve site attributes with default values", () => { const attributes = { label: "Test Site", defaultLanguage: "en" as const, themes: { default: "light" as const, light: "default-light", }, } satisfies Partial; const result = resolveSiteAttributes(attributes); // The function merges provided attributes with defaults expect(result.label).toBe("Test Site"); expect(result.defaultLanguage).toBe("en"); expect(result.themes.default).toBe("light"); expect(result.themes.light).toBe("default-light"); }); }); });