mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-03 02:11:07 +05:30
14 lines
513 B
TypeScript
14 lines
513 B
TypeScript
import { describe, it, expect, vi } from 'vitest';
|
|
import { render, screen } from '@testing-library/react';
|
|
import userEvent from '@testing-library/user-event';
|
|
import { Input } from '@/components/ui/input';
|
|
|
|
describe('Input', () => {
|
|
it('renders and accepts typing', async () => {
|
|
const onChange = vi.fn();
|
|
render(<Input aria-label="name" onChange={onChange} />);
|
|
const input = screen.getByLabelText(/name/i);
|
|
await userEvent.type(input, 'a');
|
|
expect(onChange).toHaveBeenCalled();
|
|
});
|
|
}); |