Refactor site header, heroes, and design system
This commit is contained in:
@@ -18,6 +18,8 @@ describe("metadata helpers", () => {
|
||||
it("builds root metadata with dynamic icons and social preview", () => {
|
||||
const settings = buildDefaultSiteSettings("Studio Moh");
|
||||
const metadata = buildAppMetadataFromConfig(settings, {
|
||||
siteLogoLight: null,
|
||||
siteLogoDark: null,
|
||||
favicon: {
|
||||
assetId: "fav",
|
||||
url: "/uploads/media/site-settings/favicon.svg",
|
||||
@@ -30,9 +32,9 @@ describe("metadata helpers", () => {
|
||||
|
||||
expect(metadata.title).toBe("Studio Moh");
|
||||
expect(metadata.icons).toEqual({
|
||||
icon: ["/uploads/media/site-settings/favicon.svg"],
|
||||
shortcut: ["/uploads/media/site-settings/favicon.svg"],
|
||||
apple: ["/uploads/media/site-settings/favicon.svg"],
|
||||
icon: [{ url: "/favicon.ico?v=default" }],
|
||||
shortcut: [{ url: "/favicon.ico?v=default" }],
|
||||
apple: [{ url: "/apple-icon.png?v=default" }],
|
||||
});
|
||||
expect(metadata.twitter).toMatchObject({
|
||||
card: "summary_large_image",
|
||||
@@ -46,6 +48,8 @@ describe("metadata helpers", () => {
|
||||
const metadata = buildLocalizedMetadataFromConfig({
|
||||
settings,
|
||||
bindings: {
|
||||
siteLogoLight: null,
|
||||
siteLogoDark: null,
|
||||
favicon: null,
|
||||
defaultOgImage: null,
|
||||
},
|
||||
@@ -70,6 +74,8 @@ describe("metadata helpers", () => {
|
||||
const metadata = buildLocalizedMetadataFromConfig({
|
||||
settings,
|
||||
bindings: {
|
||||
siteLogoLight: null,
|
||||
siteLogoDark: null,
|
||||
favicon: null,
|
||||
defaultOgImage: null,
|
||||
},
|
||||
|
||||
@@ -81,6 +81,28 @@ describe("portfolio validation", () => {
|
||||
}).type,
|
||||
).toBe("RICH_TEXT");
|
||||
|
||||
expect(
|
||||
sectionInputSchema.parse({
|
||||
type: "GALLERY",
|
||||
titleAr: "معرض",
|
||||
titleEn: "Single Image",
|
||||
titleDe: "Einzelbild",
|
||||
bodyAr: "",
|
||||
bodyEn: "",
|
||||
bodyDe: "",
|
||||
imagePath: "/uploads/media/sections/example.svg",
|
||||
media: {
|
||||
mode: "library",
|
||||
assetId: "asset_2",
|
||||
url: "",
|
||||
label: "Single Image",
|
||||
kind: "IMAGE",
|
||||
},
|
||||
linkUrl: "",
|
||||
sortOrder: 1,
|
||||
}).type,
|
||||
).toBe("GALLERY");
|
||||
|
||||
expect(
|
||||
assetInputSchema.parse({
|
||||
kind: "IMAGE",
|
||||
@@ -121,4 +143,28 @@ describe("portfolio validation", () => {
|
||||
}),
|
||||
).toThrow(/url/i);
|
||||
});
|
||||
|
||||
it("rejects link sections without a link", () => {
|
||||
expect(() =>
|
||||
sectionInputSchema.parse({
|
||||
type: "LINK",
|
||||
titleAr: "رابط",
|
||||
titleEn: "Link",
|
||||
titleDe: "Link",
|
||||
bodyAr: "",
|
||||
bodyEn: "",
|
||||
bodyDe: "",
|
||||
imagePath: "",
|
||||
media: {
|
||||
mode: "upload",
|
||||
assetId: "",
|
||||
url: "",
|
||||
label: "",
|
||||
kind: "IMAGE",
|
||||
},
|
||||
linkUrl: "",
|
||||
sortOrder: 0,
|
||||
}),
|
||||
).toThrow(/link/i);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user