Skip to content

Commit

Permalink
add more comprehensive test for calendar component
Browse files Browse the repository at this point in the history
  • Loading branch information
andela-akolawole committed Feb 8, 2017
1 parent ccd78ac commit 1bb9daf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/calendar/calendar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Calendar = () => (
</div>

<div className="mobile hidden info section tvn fade clipped">
<h3 className="ui medium header">Friday</h3>
<h3 className="ui medium header day">Friday</h3>
<div className="ui sub header tvn regular weight">
August 26, 2016
</div>
Expand Down
16 changes: 16 additions & 0 deletions src/components/calendar/calendar.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,20 @@ describe('<Calendar />', () => {
it('should render <ExpandIcon />', () => {
expect(wrapper.contains(<ExpandIcon />)).to.equal(true);
});

it('should render an abbreviated version of the month', () => {
expect(wrapper.find('.ui .mobile').text()).to.equal('Aug');
});

it('should render the day', () => {
expect(wrapper.find('.ui .medium .header .day').text()).to.equal('Friday');
});

it('should render a span with the date', () => {
expect(wrapper.find('span').text()).to.equal('26');
});

it('should render the complete date', () => {
expect(wrapper.find('.ui .sub .header .tvn .regular').text()).to.equal('August 26, 2016');
});
});

0 comments on commit 1bb9daf

Please sign in to comment.