From e57661a586be703ebd644636392764d2ded756da Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Tue, 28 Apr 2026 23:23:21 +0200 Subject: [PATCH] fix: payload rich text undefined data bug causing fallback rendering and 404 assets Former-commit-id: c93558b9f6125760932bf983c9a68dbf17ebad55 --- components/PayloadRichText.tsx | 4 ++-- tests/navigation.e2e.test.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/PayloadRichText.tsx b/components/PayloadRichText.tsx index 09d77ec4e..364e6cfe2 100644 --- a/components/PayloadRichText.tsx +++ b/components/PayloadRichText.tsx @@ -71,8 +71,8 @@ const jsxConverters: JSXConverters = { if (!Component) return acc; const renderFn = ({ node }: any) => { - // Pass all fields as props to the component - return ; + // Pass all fields as props to the component, and also as 'data' prop + return ; }; // Map both the direct slug and the block- prefixed slug diff --git a/tests/navigation.e2e.test.ts b/tests/navigation.e2e.test.ts index 216c269dd..9fbb99671 100644 --- a/tests/navigation.e2e.test.ts +++ b/tests/navigation.e2e.test.ts @@ -31,9 +31,9 @@ describe('E2E Navigation & Content', () => { const h1Text = await page.evaluate(() => document.querySelector('h1')?.textContent); expect(h1Text).toBeTruthy(); - // Check for specific German text that should be on the homepage - // e.g., "Kompetenzen" or a known Hero text + // Check for specific German text that should be seeded from CMS const bodyText = await page.evaluate(() => document.body.innerText); + expect(bodyText).toContain('ENERGIE & KOMMUNIKATION VERNETZEN'); expect(bodyText).toContain('Kontakt'); }); @@ -44,9 +44,9 @@ describe('E2E Navigation & Content', () => { const htmlLang = await page.evaluate(() => document.documentElement.lang); expect(htmlLang).toBe('en'); - // Check for specific English text + // Check for specific English text from CMS const bodyText = await page.evaluate(() => document.body.innerText); - // Assuming "Unternehmen" translates to "COMPANY" + expect(bodyText).toContain('NETWORKING ENERGY & COMMUNICATION'); expect(bodyText).toContain('COMPANY'); });