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 {
4444}
4545
4646Editor . propTypes = {
47- json : PropTypes . object . isRequired ,
47+ json : PropTypes . any . isRequired ,
4848 onEditorChange : PropTypes . func . isRequired ,
4949 editorChanged : PropTypes . bool . isRequired
5050} ;
Original file line number Diff line number Diff 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
2930describe ( 'Containers::Configuration' , ( ) => {
3031 it ( 'should render correctly with initial props' , ( ) => {
Original file line number Diff line number Diff 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
3939describe ( 'Containers::DataFileEdit' , ( ) => {
4040 it ( 'should render correctly' , ( ) => {
Original file line number Diff line number Diff 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
3535describe ( 'Containers::DataFileNew' , ( ) => {
3636 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 = {
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
4545describe ( 'Containers::DocumentEdit' , ( ) => {
4646 it ( 'should call clearErrors before mount' , ( ) => {
Original file line number Diff line number Diff 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
4040describe ( 'Containers::DocumentNew' , ( ) => {
4141 it ( 'should call clearErrors before mount' , ( ) => {
Original file line number Diff line number Diff 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
4545describe ( 'Containers::PageEdit' , ( ) => {
4646 it ( 'should call clearErrors before mount' , ( ) => {
Original file line number Diff line number Diff line change @@ -10,7 +10,9 @@ import { page } from './fixtures';
1010const defaultProps = {
1111 errors : [ ] ,
1212 fieldChanged : false ,
13- updated : false
13+ updated : false ,
14+ router : { } ,
15+ route : { }
1416} ;
1517
1618function setup ( props = defaultProps ) {
You can’t perform that action at this time.
0 commit comments