fix(ui): Re-architecture of CTA Modal to eliminate hydration mismatch overhead, enhance modal accessibility with focus trap and scroll lock, and add a dedicated inline form component for the footer. Fixed Payload CMS collection schema to register brochure downlod types.
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 8s
Build & Deploy / 🧪 QA (push) Failing after 1m53s
Build & Deploy / 🏗️ Build (push) Has been skipped
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 1s
CI - Lint, Typecheck & Test / quality-assurance (pull_request) Failing after 2m3s

This commit is contained in:
2026-03-03 12:23:15 +01:00
parent 449b7bc8aa
commit 34bb91c04b
7 changed files with 258 additions and 466 deletions

View File

@@ -42,24 +42,29 @@ test('AutoBrochureModal should open after 5 seconds and submit email', async ()
expect(modal).not.toBeNull();
// Ensure the email input is present inside the modal (using the placeholder to be sure)
const emailInput = await page.waitForSelector('input[name="email"]', { visible: true });
const emailInput = await page.waitForSelector('#brochure-email', { visible: true });
expect(emailInput).not.toBeNull();
// Fill the form matching BrochureCTA.tsx id=brochure-email
await page.type('input[name="email"]', 'test-brochure@mintel.me');
// Fill the form inside the modal
await page.type('#brochure-email', 'test-brochure@mintel.me');
// Submit the form
await page.click('button[type="submit"]');
// Submit the form inside the modal
await page.click('div[role="dialog"] button[type="submit"]');
// Wait for the success state UI to appear
// Wait for the success state UI to appear inside the modal
await page.waitForFunction(
() =>
document.body.innerText.includes('Successfully sent') ||
document.body.innerText.includes('Erfolgreich gesendet'),
{ timeout: 10000 },
() => {
const modal = document.querySelector('div[role="dialog"]');
return (
modal &&
(modal.innerHTML.includes('Successfully sent') ||
modal.innerHTML.includes('Erfolgreich gesendet'))
);
},
{ timeout: 25000 },
);
// Verify localStorage was set correctly so it doesn't open again
const hasSeenModal = await page.evaluate(() => localStorage.getItem('klz_brochure_modal_seen'));
expect(hasSeenModal).toBe('true');
}, 30000);
}, 60000);