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
|
yarn.lock
|
||||||
package-lock.json
|
package-lock.json
|
||||||
plugins/gatsby-plugin-matomo
|
plugins/gatsby-plugin-matomo
|
||||||
src/components/svg
|
|
||||||
coverage
|
coverage
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
sudo: required
|
dist: xenial
|
||||||
language: node_js
|
language: node_js
|
||||||
node_js: node
|
node_js: node
|
||||||
|
|
||||||
addons:
|
|
||||||
chrome: beta
|
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- node_modules
|
- node_modules
|
||||||
|
@ -4,21 +4,30 @@ import { render } from 'react-testing-library'
|
|||||||
import LinkIcon from './LinkIcon'
|
import LinkIcon from './LinkIcon'
|
||||||
|
|
||||||
describe('LinkIcon', () => {
|
describe('LinkIcon', () => {
|
||||||
const link = {
|
|
||||||
title: 'my project',
|
|
||||||
type: 'website'
|
|
||||||
}
|
|
||||||
|
|
||||||
it('renders correctly', () => {
|
it('renders correctly', () => {
|
||||||
const { container } = render(
|
const { container, rerender } = render(
|
||||||
<LinkIcon title={link.title} type={link.type} />
|
<LinkIcon title={'my project'} type={'website'} />
|
||||||
)
|
)
|
||||||
expect(container.firstChild.nodeName).toBe('svg')
|
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', () => {
|
it('does not render with unknown type', () => {
|
||||||
const link = { type: 'whatever' }
|
const { container } = render(<LinkIcon type={'whatever'} />)
|
||||||
const { container } = render(<LinkIcon type={link.type} />)
|
|
||||||
expect(container.firstChild).not.toBeInTheDocument()
|
expect(container.firstChild).not.toBeInTheDocument()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user