import { render, screen } from '@testing-library/react'; import Tabs from './Tabs'; describe('', () => { it('handles click', () => { const mockOnChange = jest.fn< [ { readonly activeTabIndex: number; dangerouslyDisableOnNavigation: () => void; event: React.MouseEvent | React.KeyboardEvent; }, ], // @ts-expect-error - TS2344 - Type 'undefined' does not satisfy the constraint 'any[]'. undefined >(); render( , ); screen.getByText('News').click(); expect(mockOnChange).toHaveBeenCalledWith( expect.objectContaining({ activeTabIndex: 0, }), ); screen.getByText('You').click(); expect(mockOnChange).toHaveBeenCalledWith( expect.objectContaining({ activeTabIndex: 1, }), ); }); });