a0fa66e8f5
Co-authored-by: Walid <87608619+WalidKorchi@users.noreply.github.com>
21 lines
764 B
TypeScript
21 lines
764 B
TypeScript
import { render } from '@testing-library/react'
|
|
|
|
import { Loader } from './'
|
|
|
|
describe('<Loader />', () => {
|
|
it('should render with correct width and height', async () => {
|
|
const size = 20
|
|
const { findByTestId } = render(<Loader width={size} height={size} />)
|
|
const progressSpinner = await findByTestId('progress-spinner')
|
|
expect(progressSpinner).toHaveStyle(`width: ${size}px`)
|
|
expect(progressSpinner).toHaveStyle(`height: ${size}px`)
|
|
})
|
|
|
|
it('should render with default width and height', async () => {
|
|
const { findByTestId } = render(<Loader />)
|
|
const progressSpinner = await findByTestId('progress-spinner')
|
|
expect(progressSpinner).toHaveStyle('width: 50px')
|
|
expect(progressSpinner).toHaveStyle('height: 50px')
|
|
})
|
|
})
|