From a8731b3245670e0149e3513973661571b5e2f8b7 Mon Sep 17 00:00:00 2001 From: Damjan Savic Date: Sun, 25 Jan 2026 01:32:07 +0100 Subject: [PATCH] auto-claude: subtask-7-1 - Create functionality tests for navigation, forms, and language switching - Add comprehensive E2E functionality tests (33 tests): - Navigation: page loading, desktop/mobile nav links, active states - Contact Form: validation, submission, error handling - Language Switching: locale changes, URL preservation, dropdown behavior - Cross-functional: combined navigation and language flows - Accessibility: ARIA attributes for nav, menu, form labels - Fix Next.js 15 ssr:false in server component issue: - Create ChatbotLoader client wrapper for dynamic import - Update layout.tsx to use ChatbotLoader instead of direct dynamic import Co-Authored-By: Claude Opus 4.5 --- src/app/[locale]/layout.tsx | 9 +- src/components/chat/ChatbotLoader.tsx | 17 + src/components/chat/index.ts | 1 + tests/e2e/functionality.spec.ts | 611 ++++++++++++++++++++++++++ 4 files changed, 631 insertions(+), 7 deletions(-) create mode 100644 src/components/chat/ChatbotLoader.tsx create mode 100644 tests/e2e/functionality.spec.ts diff --git a/src/app/[locale]/layout.tsx b/src/app/[locale]/layout.tsx index b2d14bc..bc1188c 100644 --- a/src/app/[locale]/layout.tsx +++ b/src/app/[locale]/layout.tsx @@ -2,19 +2,14 @@ import { notFound } from 'next/navigation'; import { NextIntlClientProvider } from 'next-intl'; import { getMessages, setRequestLocale } from 'next-intl/server'; import { Inter } from 'next/font/google'; -import dynamic from 'next/dynamic'; import { locales, localeMetadata, seoKeywords, type Locale } from '@/i18n/config'; import type { Metadata } from 'next'; import { Header, Footer, GlobalBackground } from '@/components/layout'; import { PersonJsonLd, ProfessionalServiceJsonLd, OrganizationJsonLd, WebSiteJsonLd } from '@/components/seo'; import { WebVitals } from '@/components/analytics'; +import { ChatbotLoader } from '@/components/chat/ChatbotLoader'; import '../globals.css'; -// Lazy load Chatbot component - uses browser-only APIs (localStorage) -const Chatbot = dynamic(() => import('@/components/chat/Chatbot').then((mod) => mod.Chatbot), { - ssr: false, -}); - const inter = Inter({ subsets: ['latin'], display: 'swap', @@ -130,7 +125,7 @@ export default async function LocaleLayout({ children, params }: Props) {