-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adicionando testes para mudanca de tamanho
- Loading branch information
1 parent
d571d3e
commit e4d4e62
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { screen } from '@testing-library/react' | ||
import { renderWithTheme } from 'utils/tests/helpers' | ||
|
||
import Button from '.' | ||
|
||
describe('<Button />', () => { | ||
it('should render a medium size by default', () => { | ||
renderWithTheme(<Button>Click Me</Button>) | ||
expect(screen.getByRole('button', { name: /Click Me/i })).toHaveStyle({ | ||
height: '4rem', | ||
padding: '0.8rem 3.2rem', | ||
'font-size': '1.4rem' | ||
}) | ||
}) | ||
|
||
it('should render a large size when props is passed', () => { | ||
renderWithTheme(<Button size="large">Click Me</Button>) | ||
expect(screen.getByRole('button', { name: /Click Me/i })).toHaveStyle({ | ||
height: '5rem', | ||
padding: '0.8rem 4.8rem', | ||
'font-size': '1.6rem' | ||
}) | ||
}) | ||
|
||
it('should render a small size when props is passed', () => { | ||
renderWithTheme(<Button size="small">Click Me</Button>) | ||
expect(screen.getByRole('button', { name: /Click Me/i })).toHaveStyle({ | ||
height: '3rem', | ||
padding: '0.8rem', | ||
'font-size': '1.2rem' | ||
}) | ||
}) | ||
}) |