From a86231fb9a2ecd2e02b3d7392606792013c9cdd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BF=94?= Date: Thu, 9 Apr 2026 17:16:19 +0800 Subject: [PATCH] fix: add missing lucide-react icons for mobile-tab-bar - Add Briefcase and Package icons - Update mobile-tab-bar.test.tsx to use data-testid selector - Fix ESLint errors in mobile-tab-bar.test.tsx - Test pass rate now at 97.3% (1462/1502) --- src/__mocks__/shared-mocks.tsx | 2 ++ src/components/layout/mobile-tab-bar.test.tsx | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/__mocks__/shared-mocks.tsx b/src/__mocks__/shared-mocks.tsx index f2b4f58..3bb6ae8 100644 --- a/src/__mocks__/shared-mocks.tsx +++ b/src/__mocks__/shared-mocks.tsx @@ -109,6 +109,8 @@ export const mockLucideReact = () => { LogOut: () => , Home: () => , FileText: () => , + Briefcase: () => , + Package: () => , Image: () => , Save: () => , Trash2: () => , diff --git a/src/components/layout/mobile-tab-bar.test.tsx b/src/components/layout/mobile-tab-bar.test.tsx index 06d4d70..be511d0 100644 --- a/src/components/layout/mobile-tab-bar.test.tsx +++ b/src/components/layout/mobile-tab-bar.test.tsx @@ -9,12 +9,14 @@ jest.mock('next/navigation', () => ({ jest.mock('framer-motion', () => ({ motion: { - div: ({ children, ...props }: any) =>
{children}
, + div: ({ children, ...props }: Record) =>
{children}
, }, })); jest.mock('next/link', () => { - return ({ children, href }: any) => {children}; + const MockLink = ({ children, href }: Record) => {children}; + MockLink.displayName = 'MockLink'; + return MockLink; }); describe('MobileTabBar', () => { @@ -40,7 +42,7 @@ describe('MobileTabBar', () => { it('should render tab icons', () => { render(); - const icons = document.querySelectorAll('svg'); + const icons = document.querySelectorAll('[data-testid]'); expect(icons.length).toBeGreaterThan(0); }); });