diff --git a/src/components/sections/news-section.integration.test.tsx b/src/components/sections/news-section.integration.test.tsx index d9b9809..50af6c3 100644 --- a/src/components/sections/news-section.integration.test.tsx +++ b/src/components/sections/news-section.integration.test.tsx @@ -2,23 +2,31 @@ import { describe, it, expect, beforeEach, afterEach, jest } from '@jest/globals import { render, screen, waitFor } from '@testing-library/react'; import '@testing-library/jest-dom'; import { NewsSection } from './news-section'; +import type { ReactNode } from 'react'; jest.mock('framer-motion', () => ({ motion: { - div: ({ children, ...props }: any) =>
{children}
, + div: ({ children, ...props }: { children?: ReactNode; [key: string]: unknown }) =>
{children}
, }, useInView: () => true, })); jest.mock('next/link', () => { - return ({ children, href }: any) => {children}; + const MockLink = ({ children, href }: { children?: ReactNode; href: string }) => {children}; + MockLink.displayName = 'MockLink'; + return MockLink; }); +jest.mock('lucide-react', () => ({ + ArrowRight: () => ArrowRight, + Calendar: () => Calendar, +})); + jest.mock('@/hooks/use-news', () => ({ useNews: jest.fn(), })); -const { useNews } = require('@/hooks/use-news'); +import { useNews } from '@/hooks/use-news'; describe('NewsSection Integration', () => { beforeEach(() => { diff --git a/src/components/sections/products-section.integration.test.tsx b/src/components/sections/products-section.integration.test.tsx index 7036149..b06d5a2 100644 --- a/src/components/sections/products-section.integration.test.tsx +++ b/src/components/sections/products-section.integration.test.tsx @@ -2,23 +2,32 @@ import { describe, it, expect, beforeEach, afterEach, jest } from '@jest/globals import { render, screen, waitFor } from '@testing-library/react'; import '@testing-library/jest-dom'; import { ProductsSection } from './products-section'; +import type { ReactNode } from 'react'; jest.mock('framer-motion', () => ({ motion: { - div: ({ children, ...props }: any) =>
{children}
, + div: ({ children, ...props }: { children?: ReactNode; [key: string]: unknown }) =>
{children}
, }, useInView: () => true, })); jest.mock('next/link', () => { - return ({ children, href }: any) => {children}; + const MockLink = ({ children, href }: { children?: ReactNode; href: string }) => {children}; + MockLink.displayName = 'MockLink'; + return MockLink; }); +jest.mock('lucide-react', () => ({ + ArrowRight: () => ArrowRight, + Check: () => Check, + TrendingUp: () => TrendingUp, +})); + jest.mock('@/hooks/use-products', () => ({ useProducts: jest.fn(), })); -const { useProducts } = require('@/hooks/use-products'); +import { useProducts } from '@/hooks/use-products'; describe('ProductsSection Integration', () => { beforeEach(() => { diff --git a/src/components/sections/services-section.integration.test.tsx b/src/components/sections/services-section.integration.test.tsx index 3195dcc..e9dfb68 100644 --- a/src/components/sections/services-section.integration.test.tsx +++ b/src/components/sections/services-section.integration.test.tsx @@ -2,23 +2,34 @@ import { describe, it, expect, beforeEach, afterEach, jest } from '@jest/globals import { render, screen, waitFor } from '@testing-library/react'; import '@testing-library/jest-dom'; import { ServicesSection } from './services-section'; +import type { ReactNode } from 'react'; jest.mock('framer-motion', () => ({ motion: { - div: ({ children, ...props }: any) =>
{children}
, + div: ({ children, ...props }: { children?: ReactNode; [key: string]: unknown }) =>
{children}
, }, useInView: () => true, })); jest.mock('next/link', () => { - return ({ children, href }: any) => {children}; + const MockLink = ({ children, href }: { children?: ReactNode; href: string }) => {children}; + MockLink.displayName = 'MockLink'; + return MockLink; }); +jest.mock('lucide-react', () => ({ + Code: () => Code, + Cloud: () => Cloud, + BarChart3: () => BarChart3, + Shield: () => Shield, + ArrowRight: () => ArrowRight, +})); + jest.mock('@/hooks/use-services', () => ({ useServices: jest.fn(), })); -const { useServices } = require('@/hooks/use-services'); +import { useServices } from '@/hooks/use-services'; describe('ServicesSection Integration', () => { beforeEach(() => { @@ -188,8 +199,7 @@ describe('ServicesSection Integration', () => { render(); await waitFor(() => { - const icons = document.querySelectorAll('svg'); - expect(icons.length).toBeGreaterThan(0); + expect(screen.getByText('Code')).toBeInTheDocument(); }); }); });