react-calendar
Advanced tools
Comparing version 2.0.3 to 2.0.4
{ | ||
"name": "react-calendar", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "A component for picking dates or date periods for your React application.", | ||
@@ -42,3 +42,3 @@ "main": "build/entry.js", | ||
"babel-core": "^6.26.0", | ||
"babel-eslint": "^8.0.0", | ||
"babel-eslint": "^8.0.1", | ||
"babel-plugin-transform-class-properties": "^6.24.1", | ||
@@ -50,3 +50,4 @@ "babel-plugin-transform-es2015-modules-commonjs": "^6.26.0", | ||
"babel-preset-stage-2": "^6.24.1", | ||
"enzyme": "^2.9.1", | ||
"enzyme": "^3.0.0", | ||
"enzyme-adapter-react-16": "^1.0.0", | ||
"eslint": "^3.19.0", | ||
@@ -57,5 +58,5 @@ "eslint-config-airbnb": "^15.1.0", | ||
"eslint-plugin-jsx-a11y": "^5.1.1", | ||
"eslint-plugin-react": "^7.3.0", | ||
"jest": "^21.1.0", | ||
"react-test-renderer": "^15.6.1" | ||
"eslint-plugin-react": "^7.4.0", | ||
"jest": "^21.2.1", | ||
"react-test-renderer": "^16.0.0" | ||
}, | ||
@@ -62,0 +63,0 @@ "files": [ |
import React from 'react'; | ||
import { mount } from 'enzyme'; | ||
import { configure, mount } from 'enzyme'; | ||
import Adapter from 'enzyme-adapter-react-16'; | ||
import Calendar from '../Calendar'; | ||
configure({ adapter: new Adapter() }); | ||
/* eslint-disable comma-dangle */ | ||
@@ -16,3 +19,3 @@ | ||
expect(navigation).toHaveLength(1); | ||
expect(navigation.length).toBe(1); | ||
}); | ||
@@ -27,3 +30,3 @@ | ||
expect(monthView).toHaveLength(1); | ||
expect(monthView.length).toBe(1); | ||
}); | ||
@@ -38,3 +41,3 @@ | ||
expect(yearView).toHaveLength(1); | ||
expect(yearView.length).toBe(1); | ||
}); | ||
@@ -52,3 +55,3 @@ | ||
expect(yearView).toHaveLength(1); | ||
expect(yearView.length).toBe(1); | ||
}); | ||
@@ -65,6 +68,7 @@ | ||
component.setProps({ view: 'month' }); | ||
component.update(); | ||
const yearView = component.find('.react-calendar__year-view'); | ||
expect(yearView).toHaveLength(1); | ||
expect(yearView.length).toBe(1); | ||
}); | ||
@@ -81,6 +85,7 @@ | ||
component.setProps({ maxDetail: 'year' }); | ||
component.update(); | ||
const yearView = component.find('.react-calendar__year-view'); | ||
expect(yearView).toHaveLength(1); | ||
expect(yearView.length).toBe(1); | ||
}); | ||
@@ -95,3 +100,3 @@ | ||
expect(monthView).toHaveLength(1); | ||
expect(monthView.length).toBe(1); | ||
expect(component.state().view).toBe('month'); | ||
@@ -110,3 +115,3 @@ }); | ||
expect(monthView).toHaveLength(1); | ||
expect(monthView.length).toBe(1); | ||
expect(component.state().view).toBe('month'); | ||
@@ -122,3 +127,3 @@ }); | ||
expect(yearView).toHaveLength(1); | ||
expect(yearView.length).toBe(1); | ||
expect(component.state().view).toBe('year'); | ||
@@ -134,3 +139,3 @@ }); | ||
expect(decadeView).toHaveLength(1); | ||
expect(decadeView.length).toBe(1); | ||
expect(component.state().view).toBe('decade'); | ||
@@ -146,3 +151,3 @@ }); | ||
expect(centuryView).toHaveLength(1); | ||
expect(centuryView.length).toBe(1); | ||
expect(component.state().view).toBe('century'); | ||
@@ -156,3 +161,3 @@ }); | ||
component.node.drillUp(); | ||
component.instance().drillUp(); | ||
@@ -167,3 +172,3 @@ expect(component.state().view).toBe('year'); | ||
component.node.drillUp(); | ||
component.instance().drillUp(); | ||
@@ -178,3 +183,3 @@ expect(component.state().view).toBe('century'); | ||
component.node.drillDown(new Date(2011, 0, 1)); | ||
component.instance().drillDown(new Date(2011, 0, 1)); | ||
@@ -189,3 +194,3 @@ expect(component.state().view).toBe('decade'); | ||
component.node.drillDown(); | ||
component.instance().drillDown(); | ||
@@ -204,3 +209,3 @@ expect(component.state().view).toBe('month'); | ||
component.node.onChange(new Date(2017, 0, 1)); | ||
component.instance().onChange(new Date(2017, 0, 1)); | ||
@@ -220,3 +225,3 @@ expect(onChange).toHaveBeenCalledWith(new Date(2017, 0, 1)); | ||
component.node.onChange(new Date(2017, 0, 1)); | ||
component.instance().onChange(new Date(2017, 0, 1)); | ||
@@ -236,3 +241,3 @@ expect(onChange).toHaveBeenCalledWith(new Date(2017, 0, 1)); | ||
component.node.onChange(new Date(2017, 0, 1)); | ||
component.instance().onChange(new Date(2017, 0, 1)); | ||
@@ -252,3 +257,3 @@ expect(onChange).toHaveBeenCalledWith(new Date(2017, 0, 1)); | ||
component.node.onChange(new Date(2017, 0, 1)); | ||
component.instance().onChange(new Date(2017, 0, 1)); | ||
@@ -268,3 +273,3 @@ expect(onChange).toHaveBeenCalledWith(new Date(2017, 0, 1, 23, 59, 59, 999)); | ||
component.node.onChange(new Date(2017, 0, 1)); | ||
component.instance().onChange(new Date(2017, 0, 1)); | ||
@@ -288,3 +293,3 @@ expect(onChange).toHaveBeenCalledWith([ | ||
component.node.onChange(new Date(2017, 0, 1)); | ||
component.instance().onChange(new Date(2017, 0, 1)); | ||
@@ -305,3 +310,3 @@ expect(onChange).toHaveBeenCalledWith(new Date(2017, 0, 1, 12)); | ||
component.node.onChange(new Date(2017, 0, 2)); | ||
component.instance().onChange(new Date(2017, 0, 2)); | ||
@@ -322,3 +327,3 @@ expect(onChange).toHaveBeenCalledWith(new Date(2017, 0, 1, 12)); | ||
component.node.onChange(new Date(2017, 0, 1)); | ||
component.instance().onChange(new Date(2017, 0, 1)); | ||
@@ -339,3 +344,3 @@ expect(onChange).toHaveBeenCalledWith(new Date(2017, 0, 2, 12)); | ||
component.node.onChange(new Date(2017, 0, 2)); | ||
component.instance().onChange(new Date(2017, 0, 2)); | ||
@@ -342,0 +347,0 @@ expect(onChange).toHaveBeenCalledWith(new Date(2017, 0, 1, 12)); |
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import { configure, shallow } from 'enzyme'; | ||
import Adapter from 'enzyme-adapter-react-16'; | ||
import Flex from '../Flex'; | ||
configure({ adapter: new Adapter() }); | ||
/* eslint-disable comma-dangle */ | ||
@@ -7,0 +10,0 @@ |
import React from 'react'; | ||
import { mount, shallow } from 'enzyme'; | ||
import { configure, shallow } from 'enzyme'; | ||
import Adapter from 'enzyme-adapter-react-16'; | ||
import Navigation from '../Navigation'; | ||
configure({ adapter: new Adapter() }); | ||
const allViews = ['century', 'decade', 'year', 'month']; | ||
@@ -163,3 +166,3 @@ | ||
const setActiveStartDateFn = jest.fn(); | ||
const component = mount( | ||
const component = shallow( | ||
<Navigation | ||
@@ -191,3 +194,3 @@ activeStartDate={new Date(2017, 0, 1)} | ||
const monthViewComponent = mount( | ||
const monthViewComponent = shallow( | ||
<Navigation | ||
@@ -238,3 +241,3 @@ activeStartDate={new Date(2017, 0, 1)} | ||
const yearViewComponent = mount( | ||
const yearViewComponent = shallow( | ||
<Navigation | ||
@@ -285,3 +288,3 @@ activeStartDate={new Date(2017, 0, 1)} | ||
const decadeViewComponent = mount( | ||
const decadeViewComponent = shallow( | ||
<Navigation | ||
@@ -332,3 +335,3 @@ activeStartDate={new Date(2017, 0, 1)} | ||
const centuryViewComponent = mount( | ||
const centuryViewComponent = shallow( | ||
<Navigation | ||
@@ -335,0 +338,0 @@ activeStartDate={new Date(2017, 0, 1)} |
import React from 'react'; | ||
import { mount } from 'enzyme'; | ||
import { configure, shallow } from 'enzyme'; | ||
import Adapter from 'enzyme-adapter-react-16'; | ||
import WeekNumbers from '../WeekNumbers'; | ||
configure({ adapter: new Adapter() }); | ||
/* eslint-disable comma-dangle */ | ||
@@ -10,3 +13,3 @@ | ||
it('renders proper weekNumbers for a year that starts in week 1 (ISO 8601)', () => { | ||
const component = mount( | ||
const component = shallow( | ||
<WeekNumbers | ||
@@ -20,3 +23,3 @@ activeStartDate={new Date(2018, 0, 1)} | ||
expect(children).toHaveLength(5); | ||
expect(children.length).toBe(5); | ||
expect(children.first().text()).toBe('1'); | ||
@@ -26,3 +29,3 @@ }); | ||
it('renders proper weekNumbers for a year that starts on week 52 (ISO 8601)', () => { | ||
const component = mount( | ||
const component = shallow( | ||
<WeekNumbers | ||
@@ -36,3 +39,3 @@ activeStartDate={new Date(2017, 0, 1)} | ||
expect(children).toHaveLength(6); | ||
expect(children.length).toBe(6); | ||
expect(children.first().text()).toBe('52'); | ||
@@ -42,3 +45,3 @@ }); | ||
it('renders proper weekNumbers for a year that starts on week 53 (ISO 8601)', () => { | ||
const component = mount( | ||
const component = shallow( | ||
<WeekNumbers | ||
@@ -52,3 +55,3 @@ activeStartDate={new Date(2016, 0, 1)} | ||
expect(children).toHaveLength(5); | ||
expect(children.length).toBe(5); | ||
expect(children.first().text()).toBe('53'); | ||
@@ -58,3 +61,3 @@ }); | ||
it('renders proper weekNumbers for a year that starts in week 1 (US)', () => { | ||
const component = mount( | ||
const component = shallow( | ||
<WeekNumbers | ||
@@ -68,5 +71,5 @@ activeStartDate={new Date(2017, 0, 1)} | ||
expect(children).toHaveLength(5); | ||
expect(children.length).toBe(5); | ||
expect(children.first().text()).toBe('1'); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
240791
5888
19