Skip to content

Commit 58e976d

Browse files
fix(test): use proper typescript interfaces in mocks
1 parent 8e7e8a5 commit 58e976d

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

components/Leaderboard.massive-scaling.test.tsx

Lines changed: 4 additions & 3 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: unknown) => <img alt="mock" {...(props as any)} />,
8+
default: (props: React.ImgHTMLAttributes<HTMLImageElement>) => <img alt="mock" {...props} />,
99
}));
1010

1111
// Mock Framer Motion
@@ -22,7 +22,7 @@ vi.mock('framer-motion', async () => {
2222
}: {
2323
children?: React.ReactNode;
2424
className?: string;
25-
onClick?: () => void;
25+
onClick?: React.MouseEventHandler<HTMLDivElement>;
2626
style?: React.CSSProperties;
2727
}) => (
2828
<div className={className} onClick={onClick} style={style} data-testid="motion-div">
@@ -41,7 +41,8 @@ beforeEach(() => {
4141
unobserve: () => null,
4242
disconnect: () => null,
4343
});
44-
window.IntersectionObserver = mockIntersectionObserver as any;
44+
window.IntersectionObserver =
45+
mockIntersectionObserver as unknown as typeof window.IntersectionObserver;
4546
});
4647

4748
describe('Leaderboard - Massive Scaling & High Bounds (Issue #2754 Equivalent)', () => {

0 commit comments

Comments
 (0)