import { render, fireEvent, screen } from '@/testing/rendering'; import { Button } from '../button'; describe('); fireEvent.click(screen.getByText('button')); expect(handler.mock.calls.length).toEqual(1); }); it('does not handle click events if props.disabled given', () => { const handler = vi.fn(); render(); fireEvent.click(screen.getByText('button')); expect(handler.mock.calls.length).toEqual(0); }); it('renders a disabled attribute if props.disabled given', () => { const { container } = render(); expect(container.firstChild).toMatchSnapshot(); }); it('renders the props.text instead of children', () => { const text = 'foo'; const children =

children

; const { container } = render(); expect(container.firstChild).toMatchSnapshot(); }); it('renders class="button--block" if props.block given', () => { const { container } = render(