File tree Expand file tree Collapse file tree 8 files changed +33
-30
lines changed Expand file tree Collapse file tree 8 files changed +33
-30
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ class Editor extends Component {
44
44
}
45
45
46
46
Editor . propTypes = {
47
- json : PropTypes . object . isRequired ,
47
+ json : PropTypes . any . isRequired ,
48
48
onEditorChange : PropTypes . func . isRequired ,
49
49
editorChanged : PropTypes . bool . isRequired
50
50
} ;
Original file line number Diff line number Diff line change @@ -11,20 +11,21 @@ const defaultProps = {
11
11
config,
12
12
editorChanged : false ,
13
13
updated : false ,
14
+ router : { } ,
15
+ route : { } ,
14
16
onEditorChange : expect . createSpy ( ) ,
15
17
putConfig : expect . createSpy ( )
16
18
} ;
17
19
18
- function setup ( props = defaultProps ) {
20
+ const setup = ( props = defaultProps ) => {
19
21
const component = shallow ( < Configuration { ...props } /> ) ;
20
-
21
22
return {
22
23
component,
23
24
props,
24
25
editor : component . find ( Editor ) ,
25
26
saveButton : component . find ( 'a' )
26
27
} ;
27
- }
28
+ } ;
28
29
29
30
describe ( 'Containers::Configuration' , ( ) => {
30
31
it ( 'should render correctly with initial props' , ( ) => {
Original file line number Diff line number Diff line change @@ -9,12 +9,14 @@ const defaultProps = {
9
9
datafile : { } ,
10
10
updated : false ,
11
11
datafileChanged : false ,
12
+ router : { } ,
13
+ route : { } ,
12
14
params : { data_file : "data_file" } ,
13
15
errors : [ ] ,
14
16
isFetching : false
15
17
} ;
16
18
17
- function setup ( props = defaultProps ) {
19
+ const setup = ( props = defaultProps ) => {
18
20
const actions = {
19
21
fetchDataFile : expect . createSpy ( ) ,
20
22
putDataFile : expect . createSpy ( ) ,
@@ -23,9 +25,7 @@ function setup(props = defaultProps) {
23
25
clearErrors : expect . createSpy ( )
24
26
} ;
25
27
26
- const component = shallow (
27
- < DataFileEdit { ...actions } { ...props } />
28
- ) ;
28
+ const component = shallow ( < DataFileEdit { ...actions } { ...props } /> ) ;
29
29
30
30
return {
31
31
component,
@@ -34,7 +34,7 @@ function setup(props = defaultProps) {
34
34
deleteButton : component . find ( '.content-side' ) . last ( ) ,
35
35
props
36
36
} ;
37
- }
37
+ } ;
38
38
39
39
describe ( 'Containers::DataFileEdit' , ( ) => {
40
40
it ( 'should render correctly' , ( ) => {
Original file line number Diff line number Diff line change @@ -10,27 +10,27 @@ const defaultProps = {
10
10
updated : false ,
11
11
datafileChanged : false ,
12
12
editorChanged : false ,
13
+ router : { } ,
14
+ route : { } ,
13
15
errors : [ ]
14
16
} ;
15
17
16
- function setup ( props = defaultProps ) {
18
+ const setup = ( props = defaultProps ) => {
17
19
const actions = {
18
20
putDataFile : expect . createSpy ( ) ,
19
21
onDataFileChanged : expect . createSpy ( ) ,
20
22
clearErrors : expect . createSpy ( )
21
23
} ;
22
24
23
- const component = shallow (
24
- < DataFileNew { ...actions } { ...props } />
25
- ) ;
25
+ const component = shallow ( < DataFileNew { ...actions } { ...props } /> ) ;
26
26
27
27
return {
28
28
component,
29
29
actions,
30
30
saveButton : component . find ( '.content-side a' ) . first ( ) ,
31
31
props
32
32
} ;
33
- }
33
+ } ;
34
34
35
35
describe ( 'Containers::DataFileNew' , ( ) => {
36
36
it ( 'should not call putDataFile if a field is not changed.' , ( ) => {
Original file line number Diff line number Diff line change @@ -13,10 +13,12 @@ const defaultProps = {
13
13
fieldChanged : false ,
14
14
updated : false ,
15
15
isFetching : false ,
16
+ router : { } ,
17
+ route : { } ,
16
18
params : { id : "the-revenant" , collection_name : "movies" }
17
19
} ;
18
20
19
- function setup ( props = defaultProps ) {
21
+ const setup = ( props = defaultProps ) => {
20
22
const actions = {
21
23
fetchDocument : expect . createSpy ( ) ,
22
24
putDocument : expect . createSpy ( ) ,
@@ -28,9 +30,7 @@ function setup(props = defaultProps) {
28
30
clearErrors : expect . createSpy ( )
29
31
} ;
30
32
31
- const component = shallow (
32
- < DocumentEdit { ...actions } { ...props } />
33
- ) ;
33
+ const component = shallow ( < DocumentEdit { ...actions } { ...props } /> ) ;
34
34
35
35
return {
36
36
component,
@@ -40,7 +40,7 @@ function setup(props = defaultProps) {
40
40
errors : component . find ( '.error-messages' ) ,
41
41
props
42
42
} ;
43
- }
43
+ } ;
44
44
45
45
describe ( 'Containers::DocumentEdit' , ( ) => {
46
46
it ( 'should call clearErrors before mount' , ( ) => {
Original file line number Diff line number Diff line change @@ -11,10 +11,12 @@ const defaultProps = {
11
11
errors : [ ] ,
12
12
fieldChanged : false ,
13
13
updated : false ,
14
+ router : { } ,
15
+ route : { } ,
14
16
params : { collection_name : doc . collection }
15
17
} ;
16
18
17
- function setup ( props = defaultProps ) {
19
+ const setup = ( props = defaultProps ) => {
18
20
const actions = {
19
21
putDocument : expect . createSpy ( ) ,
20
22
updateTitle : expect . createSpy ( ) ,
@@ -24,9 +26,7 @@ function setup(props = defaultProps) {
24
26
clearErrors : expect . createSpy ( )
25
27
} ;
26
28
27
- const component = shallow (
28
- < DocumentNew { ...actions } { ...props } />
29
- ) ;
29
+ const component = shallow ( < DocumentNew { ...actions } { ...props } /> ) ;
30
30
31
31
return {
32
32
component,
@@ -35,7 +35,7 @@ function setup(props = defaultProps) {
35
35
errors : component . find ( '.error-messages' ) ,
36
36
props
37
37
} ;
38
- }
38
+ } ;
39
39
40
40
describe ( 'Containers::DocumentNew' , ( ) => {
41
41
it ( 'should call clearErrors before mount' , ( ) => {
Original file line number Diff line number Diff line change @@ -13,10 +13,12 @@ const defaultProps = {
13
13
fieldChanged : false ,
14
14
updated : false ,
15
15
isFetching : false ,
16
+ router : { } ,
17
+ route : { } ,
16
18
params : { id : "page.md" }
17
19
} ;
18
20
19
- function setup ( props = defaultProps ) {
21
+ const setup = ( props = defaultProps ) => {
20
22
const actions = {
21
23
fetchPage : expect . createSpy ( ) ,
22
24
putPage : expect . createSpy ( ) ,
@@ -28,9 +30,7 @@ function setup(props = defaultProps) {
28
30
clearErrors : expect . createSpy ( )
29
31
} ;
30
32
31
- const component = shallow (
32
- < PageEdit { ...actions } { ...props } />
33
- ) ;
33
+ const component = shallow ( < PageEdit { ...actions } { ...props } /> ) ;
34
34
35
35
return {
36
36
component,
@@ -40,7 +40,7 @@ function setup(props = defaultProps) {
40
40
errors : component . find ( '.error-messages' ) ,
41
41
props
42
42
} ;
43
- }
43
+ } ;
44
44
45
45
describe ( 'Containers::PageEdit' , ( ) => {
46
46
it ( 'should call clearErrors before mount' , ( ) => {
Original file line number Diff line number Diff line change @@ -10,7 +10,9 @@ import { page } from './fixtures';
10
10
const defaultProps = {
11
11
errors : [ ] ,
12
12
fieldChanged : false ,
13
- updated : false
13
+ updated : false ,
14
+ router : { } ,
15
+ route : { }
14
16
} ;
15
17
16
18
function setup ( props = defaultProps ) {
You can’t perform that action at this time.
0 commit comments