diff --git a/src/renderer/components/ui/input.tsx b/src/renderer/components/ui/input.tsx new file mode 100644 index 0000000..e66133c --- /dev/null +++ b/src/renderer/components/ui/input.tsx @@ -0,0 +1,25 @@ +import * as React from "react" + +import { cn } from "@/lib/utils" + +export interface InputProps + extends React.InputHTMLAttributes {} + +const Input = React.forwardRef( + ({ className, type, ...props }, ref) => { + return ( + + ) + } +) +Input.displayName = "Input" + +export { Input } \ No newline at end of file diff --git a/tests/component/ui/input.test.tsx b/tests/component/ui/input.test.tsx new file mode 100644 index 0000000..992c252 --- /dev/null +++ b/tests/component/ui/input.test.tsx @@ -0,0 +1,14 @@ +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(); + const input = screen.getByLabelText(/name/i); + await userEvent.type(input, 'a'); + expect(onChange).toHaveBeenCalled(); + }); +}); \ No newline at end of file