Skip to content

Commit 47421ad

Browse files
Merge pull request #251 from jekyll/test-warnings
Fix test warnings
2 parents caf6a13 + 8a44fb7 commit 47421ad

File tree

8 files changed

+33
-30
lines changed

8 files changed

+33
-30
lines changed

src/components/Editor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class Editor extends Component {
4444
}
4545

4646
Editor.propTypes = {
47-
json: PropTypes.object.isRequired,
47+
json: PropTypes.any.isRequired,
4848
onEditorChange: PropTypes.func.isRequired,
4949
editorChanged: PropTypes.bool.isRequired
5050
};

src/containers/views/tests/configuration.spec.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,21 @@ const defaultProps = {
1111
config,
1212
editorChanged: false,
1313
updated: false,
14+
router: {},
15+
route: {},
1416
onEditorChange: expect.createSpy(),
1517
putConfig: expect.createSpy()
1618
};
1719

18-
function setup(props = defaultProps) {
20+
const setup = (props = defaultProps) => {
1921
const component = shallow(<Configuration {...props} />);
20-
2122
return {
2223
component,
2324
props,
2425
editor: component.find(Editor),
2526
saveButton: component.find('a')
2627
};
27-
}
28+
};
2829

2930
describe('Containers::Configuration', () => {
3031
it('should render correctly with initial props', () => {

src/containers/views/tests/datafileedit.spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ const defaultProps = {
99
datafile: {},
1010
updated: false,
1111
datafileChanged: false,
12+
router: {},
13+
route: {},
1214
params: { data_file: "data_file" },
1315
errors: [],
1416
isFetching: false
1517
};
1618

17-
function setup(props = defaultProps) {
19+
const setup = (props = defaultProps) => {
1820
const actions = {
1921
fetchDataFile: expect.createSpy(),
2022
putDataFile: expect.createSpy(),
@@ -23,9 +25,7 @@ function setup(props = defaultProps) {
2325
clearErrors: expect.createSpy()
2426
};
2527

26-
const component = shallow(
27-
<DataFileEdit {...actions} {...props} />
28-
);
28+
const component = shallow(<DataFileEdit {...actions} {...props} />);
2929

3030
return {
3131
component,
@@ -34,7 +34,7 @@ function setup(props = defaultProps) {
3434
deleteButton: component.find('.content-side').last(),
3535
props
3636
};
37-
}
37+
};
3838

3939
describe('Containers::DataFileEdit', () => {
4040
it('should render correctly', () => {

src/containers/views/tests/datafilenew.spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,27 @@ const defaultProps = {
1010
updated: false,
1111
datafileChanged: false,
1212
editorChanged: false,
13+
router: {},
14+
route: {},
1315
errors: []
1416
};
1517

16-
function setup(props = defaultProps) {
18+
const setup = (props = defaultProps) => {
1719
const actions = {
1820
putDataFile: expect.createSpy(),
1921
onDataFileChanged: expect.createSpy(),
2022
clearErrors: expect.createSpy()
2123
};
2224

23-
const component = shallow(
24-
<DataFileNew {...actions} {...props} />
25-
);
25+
const component = shallow(<DataFileNew {...actions} {...props} />);
2626

2727
return {
2828
component,
2929
actions,
3030
saveButton: component.find('.content-side a').first(),
3131
props
3232
};
33-
}
33+
};
3434

3535
describe('Containers::DataFileNew', () => {
3636
it('should not call putDataFile if a field is not changed.', () => {

src/containers/views/tests/documentedit.spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ const defaultProps = {
1313
fieldChanged: false,
1414
updated: false,
1515
isFetching: false,
16+
router: {},
17+
route: {},
1618
params: { id: "the-revenant", collection_name: "movies"}
1719
};
1820

19-
function setup(props = defaultProps) {
21+
const setup = (props = defaultProps) => {
2022
const actions = {
2123
fetchDocument: expect.createSpy(),
2224
putDocument: expect.createSpy(),
@@ -28,9 +30,7 @@ function setup(props = defaultProps) {
2830
clearErrors: expect.createSpy()
2931
};
3032

31-
const component = shallow(
32-
<DocumentEdit {...actions} {...props} />
33-
);
33+
const component = shallow(<DocumentEdit {...actions} {...props} />);
3434

3535
return {
3636
component,
@@ -40,7 +40,7 @@ function setup(props = defaultProps) {
4040
errors: component.find('.error-messages'),
4141
props
4242
};
43-
}
43+
};
4444

4545
describe('Containers::DocumentEdit', () => {
4646
it('should call clearErrors before mount', () => {

src/containers/views/tests/documentnew.spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ const defaultProps = {
1111
errors: [],
1212
fieldChanged: false,
1313
updated: false,
14+
router: {},
15+
route: {},
1416
params: { collection_name: doc.collection }
1517
};
1618

17-
function setup(props = defaultProps) {
19+
const setup = (props = defaultProps) => {
1820
const actions = {
1921
putDocument: expect.createSpy(),
2022
updateTitle: expect.createSpy(),
@@ -24,9 +26,7 @@ function setup(props = defaultProps) {
2426
clearErrors: expect.createSpy()
2527
};
2628

27-
const component = shallow(
28-
<DocumentNew {...actions} {...props} />
29-
);
29+
const component = shallow(<DocumentNew {...actions} {...props} />);
3030

3131
return {
3232
component,
@@ -35,7 +35,7 @@ function setup(props = defaultProps) {
3535
errors: component.find('.error-messages'),
3636
props
3737
};
38-
}
38+
};
3939

4040
describe('Containers::DocumentNew', () => {
4141
it('should call clearErrors before mount', () => {

src/containers/views/tests/pageedit.spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ const defaultProps = {
1313
fieldChanged: false,
1414
updated: false,
1515
isFetching: false,
16+
router: {},
17+
route: {},
1618
params: { id: "page.md"}
1719
};
1820

19-
function setup(props = defaultProps) {
21+
const setup = (props = defaultProps) => {
2022
const actions = {
2123
fetchPage: expect.createSpy(),
2224
putPage: expect.createSpy(),
@@ -28,9 +30,7 @@ function setup(props = defaultProps) {
2830
clearErrors: expect.createSpy()
2931
};
3032

31-
const component = shallow(
32-
<PageEdit {...actions} {...props} />
33-
);
33+
const component = shallow(<PageEdit {...actions} {...props} />);
3434

3535
return {
3636
component,
@@ -40,7 +40,7 @@ function setup(props = defaultProps) {
4040
errors: component.find('.error-messages'),
4141
props
4242
};
43-
}
43+
};
4444

4545
describe('Containers::PageEdit', () => {
4646
it('should call clearErrors before mount', () => {

src/containers/views/tests/pagenew.spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ import { page } from './fixtures';
1010
const defaultProps = {
1111
errors: [],
1212
fieldChanged: false,
13-
updated: false
13+
updated: false,
14+
router: {},
15+
route: {}
1416
};
1517

1618
function setup(props = defaultProps) {

0 commit comments

Comments
 (0)