Skip to content

Commit 581f5d8

Browse files
fix(test): use proper typescript interfaces in mocks
1 parent ab0243d commit 581f5d8

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

components/Leaderboard.mouse-interactivity.test.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Leaderboard, { Contributor } from './Leaderboard';
55

66
// Mock Next.js Image
77
vi.mock('next/image', () => ({
8-
default: (props: any) => <img {...props} />,
8+
default: (props: React.ImgHTMLAttributes<HTMLImageElement>) => <img alt="mock" {...props} />,
99
}));
1010

1111
// Mock framer-motion to render children with classes and event handlers
@@ -14,7 +14,17 @@ vi.mock('framer-motion', async () => {
1414
return {
1515
...actual,
1616
motion: {
17-
div: ({ children, className, onClick, style }: any) => (
17+
div: ({
18+
children,
19+
className,
20+
onClick,
21+
style,
22+
}: {
23+
children?: React.ReactNode;
24+
className?: string;
25+
onClick?: React.MouseEventHandler<HTMLDivElement>;
26+
style?: React.CSSProperties;
27+
}) => (
1828
<div className={className} onClick={onClick} style={style} data-testid="motion-div">
1929
{children}
2030
</div>

0 commit comments

Comments
 (0)