mirror of
https://github.com/kremalicious/portfolio.git
synced 2024-12-22 09:13:19 +01:00
cleanup
This commit is contained in:
parent
6bdcda3141
commit
0666dba344
1
.gitignore
vendored
1
.gitignore
vendored
@ -11,5 +11,4 @@ yarn-debug.log*
|
||||
yarn.lock
|
||||
package-lock.json
|
||||
plugins/gatsby-plugin-matomo
|
||||
src/components/svg
|
||||
coverage
|
||||
|
@ -1,10 +1,7 @@
|
||||
sudo: required
|
||||
dist: xenial
|
||||
language: node_js
|
||||
node_js: node
|
||||
|
||||
addons:
|
||||
chrome: beta
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
|
@ -4,21 +4,30 @@ import { render } from 'react-testing-library'
|
||||
import LinkIcon from './LinkIcon'
|
||||
|
||||
describe('LinkIcon', () => {
|
||||
const link = {
|
||||
title: 'my project',
|
||||
type: 'website'
|
||||
}
|
||||
|
||||
it('renders correctly', () => {
|
||||
const { container } = render(
|
||||
<LinkIcon title={link.title} type={link.type} />
|
||||
const { container, rerender } = render(
|
||||
<LinkIcon title={'my project'} type={'website'} />
|
||||
)
|
||||
expect(container.firstChild.nodeName).toBe('svg')
|
||||
|
||||
rerender(<LinkIcon type={'github'} />)
|
||||
expect(container.firstChild.nodeName).toBe('svg')
|
||||
|
||||
rerender(<LinkIcon type={'dribbble'} />)
|
||||
expect(container.firstChild.nodeName).toBe('svg')
|
||||
|
||||
rerender(<LinkIcon type={'info'} />)
|
||||
expect(container.firstChild.nodeName).toBe('svg')
|
||||
|
||||
rerender(<LinkIcon type={'download'} />)
|
||||
expect(container.firstChild.nodeName).toBe('svg')
|
||||
|
||||
rerender(<LinkIcon type={'styleguide'} />)
|
||||
expect(container.firstChild.nodeName).toBe('svg')
|
||||
})
|
||||
|
||||
it('does not render with unknown type', () => {
|
||||
const link = { type: 'whatever' }
|
||||
const { container } = render(<LinkIcon type={link.type} />)
|
||||
const { container } = render(<LinkIcon type={'whatever'} />)
|
||||
expect(container.firstChild).not.toBeInTheDocument()
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user