Skip to content

Commit

Permalink
Fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
javivelasco committed Aug 7, 2016
1 parent 739acbc commit fae42a8
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions components/date_picker/__test__/index.spec.js
@@ -1,5 +1,4 @@
import expect from 'expect';
import React from 'react';
import theme from '../theme.scss';
import { DatePickerDialog } from '../DatePicker';
import utils from '../../utils/testing';
Expand All @@ -8,9 +7,7 @@ describe('DatePickerDialog', function () {
describe('#on mount', function () {
it('passes value through to calendar if no maxDate/minDate specified', function () {
const value = new Date(2016, 1, 1);

const wrapper = utils.shallowRenderComponent(DatePickerDialog, {theme, value});

expect(getDatePassedToCalendar(wrapper)).toBe(value);
});

Expand All @@ -19,17 +16,14 @@ describe('DatePickerDialog', function () {

it('passes through a value after minDate', function () {
const value = new Date(2016, 1, 3);

const wrapper = utils.shallowRenderComponent(DatePickerDialog, {theme, value, minDate});

expect(getDatePassedToCalendar(wrapper)).toBe(value);
});

it('sanitises a value before minDate to minDate', function () {
const wrapper = utils.shallowRenderComponent(DatePickerDialog, {
theme, value: new Date(2016, 1, 1), minDate
});

expect(getDatePassedToCalendar(wrapper)).toBe(minDate);
});
});
Expand All @@ -39,17 +33,14 @@ describe('DatePickerDialog', function () {

it('passes through a value before maxDate', function () {
const value = new Date(2016, 1, 1);

const wrapper = utils.shallowRenderComponent(DatePickerDialog, {theme, value, maxDate});

expect(getDatePassedToCalendar(wrapper)).toBe(value);
});

it('sanitises a value after maxDate to maxDate', function () {
const wrapper = utils.shallowRenderComponent(DatePickerDialog, {
theme, value: new Date(2016, 1, 3), maxDate
});

expect(getDatePassedToCalendar(wrapper)).toBe(maxDate);
});
});
Expand All @@ -65,7 +56,6 @@ describe('DatePickerDialog', function () {
minDate,
maxDate
});

expect(getDatePassedToCalendar(wrapper)).toBe(minDate);
});

Expand All @@ -76,7 +66,6 @@ describe('DatePickerDialog', function () {
minDate,
maxDate
});

expect(getDatePassedToCalendar(wrapper)).toBe(maxDate);
});

Expand All @@ -87,7 +76,7 @@ describe('DatePickerDialog', function () {
});
});

function getDatePassedToCalendar(wrapper) {
function getDatePassedToCalendar (wrapper) {
return wrapper.props.children[1].props.children.props.selectedDate;
}
});
Expand Down

0 comments on commit fae42a8

Please sign in to comment.