mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
19 lines
585 B
TypeScript
19 lines
585 B
TypeScript
import { render, screen } from '@testing-library/react';
|
|
import userEvent from '@testing-library/user-event';
|
|
import { vi } from 'vitest';
|
|
|
|
import { ToggleMenuButton } from './ToggleMenuButton';
|
|
|
|
describe('ToggleMenuButton', () => {
|
|
describe('onClick props', () => {
|
|
it('should call the callback when the user click on the button', async () => {
|
|
const handler = vi.fn();
|
|
|
|
render(<ToggleMenuButton onClick={handler} />);
|
|
const button = screen.getByRole('button');
|
|
await userEvent.click(button);
|
|
|
|
expect(handler).toHaveBeenCalled();
|
|
});
|
|
});
|
|
});
|