Skip to content

Commit

Permalink
Pass them tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonEtco committed Dec 15, 2018
1 parent 9dce4a4 commit 95a5b33
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions server/tests/EventIcon.test.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
import React from 'react'
import EventIcon from '../src/components/EventIcon'
import { shallow } from 'enzyme'
import { Globe, IssueOpened, Package } from '@githubprimer/octicons-react'

describe('<EventIcon />', () => {
describe('render', () => {
it('should render the correct octicon', () => {
const wrapper = shallow(<EventIcon event="ping" />)
expect(wrapper.find('GlobeIcon').length).toBe(1)
expect(wrapper.find('Octicon').props().icon).toEqual(Globe)
})

it('renders the correct octicon if there an action', () => {
const wrapper = shallow(<EventIcon event="issues" action="opened" />)
expect(wrapper.find('IssueOpenedIcon').length).toBe(1)
expect(wrapper.find('Octicon').props().icon).toEqual(IssueOpened)
})

it('renders the package octicon if the event is unknown', () => {
const wrapper = shallow(<EventIcon event="nothing" />)
expect(wrapper.find('PackageIcon').length).toBe(1)
expect(wrapper.find('Octicon').props().icon).toEqual(Package)
})
})
})

0 comments on commit 95a5b33

Please sign in to comment.