From 4bcd0d18b53748f4666cb94c3e5ca7dfecdea240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BF=94?= Date: Thu, 9 Apr 2026 17:11:03 +0800 Subject: [PATCH] fix: add missing lucide-react icons for sections components - Add TrendingUp, Code, Cloud, BarChart3 icons for products-section - Add Send, HeadphonesIcon, Building2 icons for other sections - Update services-section.test.tsx to use data-testid selector - Fix ESLint errors in services-section.test.tsx - Test pass rate now at 96.3% (1446/1502) --- src/__mocks__/shared-mocks.tsx | 7 +++++++ src/components/sections/services-section.test.tsx | 8 +++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/__mocks__/shared-mocks.tsx b/src/__mocks__/shared-mocks.tsx index 2f56d30..f2b4f58 100644 --- a/src/__mocks__/shared-mocks.tsx +++ b/src/__mocks__/shared-mocks.tsx @@ -126,6 +126,13 @@ export const mockLucideReact = () => { MoreVertical: () => , ChevronUp: () => , ExternalLink: () => , + TrendingUp: () => , + Code: () => , + Cloud: () => , + BarChart3: () => , + Send: () => , + HeadphonesIcon: () => , + Building2: () => , })); }; diff --git a/src/components/sections/services-section.test.tsx b/src/components/sections/services-section.test.tsx index 03f2d95..aecddcf 100644 --- a/src/components/sections/services-section.test.tsx +++ b/src/components/sections/services-section.test.tsx @@ -5,13 +5,15 @@ import { ServicesSection } from './services-section'; jest.mock('framer-motion', () => ({ motion: { - div: ({ children, ...props }: any) =>
{children}
, + div: ({ children, ...props }: Record) =>
{children}
, }, useInView: () => true, })); jest.mock('next/link', () => { - return ({ children, href }: any) => {children}; + const MockLink = ({ children, href }: Record) => {children}; + MockLink.displayName = 'MockLink'; + return MockLink; }); jest.mock('@/hooks/use-services', () => ({ @@ -75,7 +77,7 @@ describe('ServicesSection', () => { it('should render service icons', () => { render(); - const icons = document.querySelectorAll('svg'); + const icons = document.querySelectorAll('[data-testid]'); expect(icons.length).toBeGreaterThan(0); }); });