import { render, screen } from '@testing-library/react'; import { describe, expect, it } from 'vitest'; import { Button } from './Button.tsx'; describe('Button', () => { it('should render', () => { render(); expect(screen.getByText('My Button')).toBeInTheDocument(); }); it('should contain a custom class name', () => { render(); expect(screen.getByText('My Button')).toHaveClass('foo'); }); it('should render a custom class name within a child element, if asChild is set to true', () => { render( ); expect(screen.getByTestId('link')).toHaveClass('foo'); }); });