2021-10-24 05:19:39 +02:00
|
|
|
import { render } from '@testing-library/react'
|
|
|
|
|
2022-02-19 23:20:33 +01:00
|
|
|
import { SocialMedia, SocialMediaButton } from '.'
|
2021-10-24 05:19:39 +02:00
|
|
|
|
|
|
|
describe('<SocialMediaButton />', () => {
|
|
|
|
it('should render the social media', async () => {
|
|
|
|
const socialMedia: SocialMedia = 'Discord'
|
|
|
|
const { findByAltText } = render(
|
|
|
|
<SocialMediaButton socialMedia={socialMedia} />
|
|
|
|
)
|
|
|
|
const socialMediaButton = await findByAltText(socialMedia)
|
|
|
|
expect(socialMediaButton).toBeInTheDocument()
|
|
|
|
})
|
|
|
|
|
|
|
|
it('should render with a black text color with Google social media', async () => {
|
|
|
|
const socialMedia: SocialMedia = 'Google'
|
|
|
|
const { findByTestId } = render(
|
|
|
|
<SocialMediaButton socialMedia={socialMedia} />
|
|
|
|
)
|
2022-01-07 21:21:38 +01:00
|
|
|
const button = await findByTestId('social-media-button')
|
2021-10-24 05:19:39 +02:00
|
|
|
expect(button).toHaveStyle('color: #000')
|
|
|
|
})
|
|
|
|
})
|