1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-06-14 00:13:23 +02:00
portfolio/src/components/LogoUnit/index.test.tsx

25 lines
758 B
TypeScript
Raw Normal View History

2019-05-30 22:55:12 +02:00
import { render } from '@testing-library/react'
import LogoUnit from '.'
import meta from '../../../_content/meta.json'
2019-04-15 00:25:54 +02:00
describe('LogoUnit', () => {
it('renders correctly from data file values', () => {
2019-06-10 23:06:55 +02:00
const { container } = render(<LogoUnit />)
2019-04-15 00:25:54 +02:00
expect(container.firstChild).toBeInTheDocument()
2019-06-10 23:06:55 +02:00
expect(container.querySelector('.title')).toHaveTextContent(
meta.author.name.toLowerCase()
2019-06-10 23:06:55 +02:00
)
expect(container.querySelector('.description')).toHaveTextContent(
meta.author.label.toLowerCase()
2019-06-10 23:06:55 +02:00
)
2019-04-15 00:25:54 +02:00
})
it('renders in small variant', () => {
const { container } = render(<LogoUnit small />)
2019-04-15 00:25:54 +02:00
expect(container.firstChild).toBeInTheDocument()
expect(container.querySelector('.small')).toBeInTheDocument()
2019-04-15 00:25:54 +02:00
})
})