@navinc/base-react-components
Version:
Nav's Pattern Library
15 lines (12 loc) • 471 B
JavaScript
import { render, screen } from '@testing-library/react'
import { Button } from './button.js'
describe('<Button />', () => {
it('renders LoadingDots if its loading', () => {
render(<Button isLoading>button me</Button>)
expect(screen.getByTestId('button-loading-dots')).toBeInTheDocument()
})
it('renders the children if its not loading', () => {
render(<Button>button me</Button>)
expect(screen.getByText(/button me/i)).toBeInTheDocument()
})
})