diff --git a/packages/ui/src/components/ui/button.test.tsx b/packages/ui/src/components/ui/button.test.tsx new file mode 100644 index 0000000..7959007 --- /dev/null +++ b/packages/ui/src/components/ui/button.test.tsx @@ -0,0 +1,22 @@ +import { render, screen } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; +import { Button } from './button'; + +describe('Button', () => { + it('renders correctly', () => { + render(); + expect(screen.getByText('Click me')).toBeInTheDocument(); + }); + + it('handles click events', async () => { + const handleClick = jest.fn(); + render(); + await userEvent.click(screen.getByText('Click me')); + expect(handleClick).toHaveBeenCalled(); + }); + + it('renders with variant classes', () => { + render(); + expect(screen.getByText('Delete')).toHaveClass('bg-destructive'); + }); +});