|
|
@@ -99,6 +99,29 @@ describe('LinkButton', () => { |
|
|
|
expect(button).toHaveClass('pl-2 gap-2 pr-2'); |
|
|
|
}); |
|
|
|
|
|
|
|
it('renders an icon', () => { |
|
|
|
render( |
|
|
|
<LinkButton |
|
|
|
icon={<div />} |
|
|
|
/>, |
|
|
|
); |
|
|
|
|
|
|
|
const icon = screen.getByTestId('icon'); |
|
|
|
expect(icon).toBeInTheDocument(); |
|
|
|
}); |
|
|
|
|
|
|
|
it('renders icon after children', () => { |
|
|
|
render( |
|
|
|
<LinkButton |
|
|
|
iconAfterChildren |
|
|
|
icon={<span />} |
|
|
|
/>, |
|
|
|
); |
|
|
|
|
|
|
|
const childrenParent = screen.getByTestId('childrenParent'); |
|
|
|
expect(childrenParent).toHaveClass('flex-row-reverse'); |
|
|
|
}); |
|
|
|
|
|
|
|
describe.each` |
|
|
|
size | className |
|
|
|
${'small'} | ${'h-10'} |
|
|
@@ -179,17 +202,6 @@ describe('LinkButton', () => { |
|
|
|
expect(children).toHaveTextContent('Foo'); |
|
|
|
}); |
|
|
|
|
|
|
|
it.each(Button.AVAILABLE_TYPES)('renders a link with type %s', (buttonType) => { |
|
|
|
render( |
|
|
|
<LinkButton |
|
|
|
href="#" |
|
|
|
type={buttonType} |
|
|
|
/>, |
|
|
|
); |
|
|
|
const button = screen.getByRole('link'); |
|
|
|
expect(button).toHaveProperty('type', buttonType); |
|
|
|
}); |
|
|
|
|
|
|
|
it('renders a disabled link', () => { |
|
|
|
render( |
|
|
|
<LinkButton |
|
|
|