Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
feat: add dashboard icon
Browse files Browse the repository at this point in the history
Add dashboard icon to Icon component and create test.

re #135
  • Loading branch information
ocBruno committed Dec 5, 2019
1 parent aed4bd0 commit eea6a45
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/components/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const iconMap = {
'appointment-add': 'calendar-plus',
'appointment-remove': 'calendar-minus',
calendar: 'calendar-alt',
dashboard: 'columns',
image: 'camera',
incident: 'file-alt',
lab: 'microscope',
Expand Down
1 change: 1 addition & 0 deletions src/components/Icon/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export type IconType =
| 'appointment-add'
| 'appointment-remove'
| 'calendar'
| 'dashboard'
| 'image'
| 'incident'
| 'lab'
Expand Down
6 changes: 3 additions & 3 deletions stories/icons.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ storiesOf('Icons', module)
<span>Admin: </span>
<Icon icon="admin" />
<br />

<span>Apointment: </span>
<Icon icon="appointment" />
<br />
Expand All @@ -28,11 +27,12 @@ storiesOf('Icons', module)
<span>Remove Apointment: </span>
<Icon icon="appointment-remove" />
<br />

<span>Calendar: </span>
<Icon icon="calendar" />
<br />

<span>Dashboard: </span>
<Icon icon="dashboard" />
<br />
<span>Image: </span>
<Icon icon="image" />
<br />
Expand Down
7 changes: 7 additions & 0 deletions test/icon.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ describe('Icon', () => {
expect(fontAwesomeIcon.props().icon).toBe('calendar-alt')
})

it('Dashboard Icon renders itself without crashing', () => {
const dashboardIconWrapper = shallow(<Icon icon="dashboard" />)
const fontAwesomeIcon = dashboardIconWrapper.find(FontAwesomeIcon)
expect(fontAwesomeIcon).toHaveLength(1)
expect(fontAwesomeIcon.props().icon).toBe('columns')
})

it('Image Icon renders itself without crashing', () => {
const imageIconWrapper = shallow(<Icon icon="image" />)
const fontAwesomeIcon = imageIconWrapper.find(FontAwesomeIcon)
Expand Down

0 comments on commit eea6a45

Please sign in to comment.