test/user-journey #3

Merged
zhangxiang merged 142 commits from test/user-journey into dev 2026-04-12 13:17:03 +08:00
2 changed files with 12 additions and 3 deletions
Showing only changes of commit 4bcd0d18b5 - Show all commits
+7
View File
@@ -126,6 +126,13 @@ export const mockLucideReact = () => {
MoreVertical: () => <span data-testid="more-vertical-icon" />,
ChevronUp: () => <span data-testid="chevron-up" />,
ExternalLink: () => <span data-testid="external-link-icon" />,
TrendingUp: () => <span data-testid="trending-up-icon" />,
Code: () => <span data-testid="code-icon" />,
Cloud: () => <span data-testid="cloud-icon" />,
BarChart3: () => <span data-testid="bar-chart-icon" />,
Send: () => <span data-testid="send-icon" />,
HeadphonesIcon: () => <span data-testid="headphones-icon" />,
Building2: () => <span data-testid="building-icon" />,
}));
};
@@ -5,13 +5,15 @@ import { ServicesSection } from './services-section';
jest.mock('framer-motion', () => ({
motion: {
div: ({ children, ...props }: any) => <div {...props}>{children}</div>,
div: ({ children, ...props }: Record<string, unknown>) => <div {...props}>{children}</div>,
},
useInView: () => true,
}));
jest.mock('next/link', () => {
return ({ children, href }: any) => <a href={href}>{children}</a>;
const MockLink = ({ children, href }: Record<string, unknown>) => <a href={href as string}>{children}</a>;
MockLink.displayName = 'MockLink';
return MockLink;
});
jest.mock('@/hooks/use-services', () => ({
@@ -75,7 +77,7 @@ describe('ServicesSection', () => {
it('should render service icons', () => {
render(<ServicesSection />);
const icons = document.querySelectorAll('svg');
const icons = document.querySelectorAll('[data-testid]');
expect(icons.length).toBeGreaterThan(0);
});
});