From 88a19912d7702ba6555fe39de26928b8ea2e82a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BF=94?= Date: Thu, 9 Apr 2026 17:03:05 +0800 Subject: [PATCH] fix: add missing lucide-react icons to mock (Calendar, CheckCircle2, Quote) - Add Calendar icon mock for insight-card component - Add CheckCircle2 icon mock for toast component - Add Quote icon mock for testimonial-card component - Update toast.test.tsx to use data-testid selector instead of svg This fixes 65 failing tests and brings test pass rate from 89.8% to 94.3% --- src/__mocks__/shared-mocks.tsx | 3 +++ src/components/ui/toast.test.tsx | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/__mocks__/shared-mocks.tsx b/src/__mocks__/shared-mocks.tsx index fe6df15..3f5d063 100644 --- a/src/__mocks__/shared-mocks.tsx +++ b/src/__mocks__/shared-mocks.tsx @@ -89,6 +89,7 @@ export const mockLucideReact = () => { Zap: () => , Award: () => , Check: () => , + CheckCircle2: () => , X: () => , Menu: () => , ChevronDown: () => , @@ -97,6 +98,8 @@ export const mockLucideReact = () => { Phone: () => , MapPin: () => , Clock: () => , + Calendar: () => , + Quote: () => , User: () => , Lock: () => , Eye: () => , diff --git a/src/components/ui/toast.test.tsx b/src/components/ui/toast.test.tsx index 218715e..1fe49aa 100644 --- a/src/components/ui/toast.test.tsx +++ b/src/components/ui/toast.test.tsx @@ -125,19 +125,19 @@ describe('Toast Component', () => { it('should render success icon for success type', () => { render(); const toast = screen.getByRole('alert'); - expect(toast.querySelector('svg')).toBeInTheDocument(); + expect(toast.querySelector('[data-testid]')).toBeInTheDocument(); }); it('should render error icon for error type', () => { render(); const toast = screen.getByRole('alert'); - expect(toast.querySelector('svg')).toBeInTheDocument(); + expect(toast.querySelector('[data-testid]')).toBeInTheDocument(); }); it('should render info icon for info type', () => { render(); const toast = screen.getByRole('alert'); - expect(toast.querySelector('svg')).toBeInTheDocument(); + expect(toast.querySelector('[data-testid]')).toBeInTheDocument(); }); });