Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fork branch #43

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions __tests__/Calendar.react-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import moment from 'moment';
import {
mount,
shallow,
configure,
} from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
configure({ adapter: new Adapter(), disableLifecycleMethods: true });

import Calendar from '../src/js/components/calendar';
import Timeslot from '../src/js/components/timeslot';
import { DEFAULT_TIMESLOTS } from '../src/js/constants/day';
Expand Down
4 changes: 4 additions & 0 deletions __tests__/Day.react-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import moment from 'moment';
import {
shallow,
mount,
configure,
} from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
configure({ adapter: new Adapter(), disableLifecycleMethods: true });

import Day from '../src/js/components/day';
import Timeslot from '../src/js/components/timeslot';
import {
Expand Down
4 changes: 4 additions & 0 deletions __tests__/Month.react-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import moment from 'moment';
import Calendar from 'calendarjs';
import {
mount,
configure,
} from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
configure({ adapter: new Adapter(), disableLifecycleMethods: true });

import Month from '../src/js/components/month';
import helpers from '../src/js/util/helpers';

Expand Down
3 changes: 3 additions & 0 deletions __tests__/Timeslot.react-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import Timeslot from '../src/js/components/timeslot';
import {
shallow,
mount,
configure,
} from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
configure({ adapter: new Adapter(), disableLifecycleMethods: true });

import {
DEFAULT,
Expand Down
6 changes: 5 additions & 1 deletion __tests__/Week.react-test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import React from 'react';
import React from 'react';
import renderer from 'react-test-renderer';
import sinon from 'sinon';
import moment from 'moment';
import Calendar from 'calendarjs';
import {
shallow,
mount,
configure,
} from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
configure({ adapter: new Adapter(), disableLifecycleMethods: true });

import Week from '../src/js/components/week';
import Day from '../src/js/components/day';
Expand All @@ -19,6 +22,7 @@ import {
DEFAULT_TIMESLOT_SHOW_FORMAT,
} from '../src/js/constants/day';


const cal = new Calendar(2017, 4);

describe('Render tests', () => {
Expand Down
22 changes: 15 additions & 7 deletions build/build.min.js

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"babel-preset-react": "^6.24.1",
"classnames": "^2.2.5",
"css-loader": "^0.28.4",
"enzyme": "^2.8.2",
"enzyme": "^3.10.0",
"eslint": "^3.19.0",
"eslint-plugin-jest": "^20.0.3",
"eslint-plugin-react": "^7.0.1",
Expand All @@ -45,9 +45,9 @@
"marked": "^0.3.6",
"node-sass": "^4.5.3",
"prop-types": "^15.5.10",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"react-test-renderer": "^15.5.4",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-test-renderer": "^16.9.0",
"sass-loader": "^6.0.5",
"sinon": "^2.3.2",
"style-loader": "^0.18.1",
Expand All @@ -57,6 +57,7 @@
},
"dependencies": {
"calendarjs": "^0.1.0",
"enzyme-adapter-react-16": "^1.14.0",
"moment": "^2.18.1"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/calendar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export default class Calendar extends React.Component {
this.renderDays = Object.assign({}, defaultRenderDays, renderDays);
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) { //eslint-disable-line camelcase
this._updateInputProps(nextProps.startDateInputProps, nextProps.endDateInputProps);
this._updateTimeslotProps(nextProps.timeslotProps);
this._updateRenderDays(nextProps.renderDays);
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/month.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export default class Month extends React.Component {
}
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) { //eslint-disable-line camelcase
this.setState({
currentWeekIndex: this._getStartingWeek(nextProps.currentDate, nextProps.weeks),
});
Expand Down