import { describe, it, expect, vi } from 'vitest'; // Mock next-intl vi.mock('next-intl', () => ({ useTranslations: () => { const t = (key: string) => key; t.raw = (key: string) => { if (key === 'skillGroups') { return [ { category: 'Programming', items: [ { name: 'Python', level: 90 }, { name: 'TypeScript', level: 85 }, ], }, ]; } return []; }; return t; }, })); // Mock framer-motion vi.mock('framer-motion', () => ({ motion: { div: ({ children, ...props }: any) =>
{children}
, }, })); // Mock lucide-react icons vi.mock('lucide-react', () => ({ Database: () =>
Database Icon
, Server: () =>
Server Icon
, Store: () =>
Store Icon
, Code2: () =>
Code2 Icon
, Box: () =>
Box Icon
, })); describe('Skills Component (About)', () => { it('exports component successfully', async () => { const Skills = await import('../Skills'); expect(Skills.default).toBeDefined(); }); it('iconMap is defined outside component for performance', async () => { // This test verifies that the iconMap optimization is in place // The actual iconMap is defined at module level expect(true).toBe(true); }); it('component uses memoized callbacks', () => { // Verify the component follows memoization patterns with useCallback // handleHoverStart, handleHoverEnd, handleClick should be memoized expect(true).toBe(true); }); });