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 7 additions and 3 deletions
Showing only changes of commit a86231fb9a - Show all commits
+2
View File
@@ -109,6 +109,8 @@ export const mockLucideReact = () => {
LogOut: () => <span data-testid="logout-icon" />,
Home: () => <span data-testid="home-icon" />,
FileText: () => <span data-testid="file-text-icon" />,
Briefcase: () => <span data-testid="briefcase-icon" />,
Package: () => <span data-testid="package-icon" />,
Image: () => <span data-testid="image-icon" />,
Save: () => <span data-testid="save-icon" />,
Trash2: () => <span data-testid="trash-icon" />,
@@ -9,12 +9,14 @@ jest.mock('next/navigation', () => ({
jest.mock('framer-motion', () => ({
motion: {
div: ({ children, ...props }: any) => <div {...props}>{children}</div>,
div: ({ children, ...props }: Record<string, unknown>) => <div {...props}>{children}</div>,
},
}));
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;
});
describe('MobileTabBar', () => {
@@ -40,7 +42,7 @@ describe('MobileTabBar', () => {
it('should render tab icons', () => {
render(<MobileTabBar />);
const icons = document.querySelectorAll('svg');
const icons = document.querySelectorAll('[data-testid]');
expect(icons.length).toBeGreaterThan(0);
});
});