mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-03 02:11:07 +05:30
13 lines
555 B
TypeScript
13 lines
555 B
TypeScript
import { describe, it, expect, vi } from 'vitest';
|
|
import { render, screen } from '@testing-library/react';
|
|
import userEvent from '@testing-library/user-event';
|
|
import { Checkbox } from '@/components/ui/checkbox';
|
|
|
|
describe('Checkbox', () => {
|
|
it('toggles checked state on click', async () => {
|
|
const onCheckedChange = vi.fn();
|
|
render(<Checkbox aria-label="agree" onCheckedChange={onCheckedChange} />);
|
|
await userEvent.click(screen.getByRole('checkbox', { name: /agree/i }));
|
|
expect(onCheckedChange).toHaveBeenCalledWith(true);
|
|
});
|
|
}); |