@@ -29,6 +29,7 @@ describe('Migration Config validation', () => {
2929 . throws ( "Token with alias 'invalidAlias' was not found" ) ;
3030
3131 test
32+ . loadConfig ( { root : process . cwd ( ) } )
3233 . stub ( cliux , 'confirm' , ( ) => false )
3334 . stdout ( )
3435 . command ( [
@@ -50,6 +51,7 @@ describe('Migration Config validation', () => {
5051 . it ( 'deny config confirmation' ) ;
5152
5253 test
54+ . loadConfig ( { root : process . cwd ( ) } )
5355 . stub ( cliux , 'confirm' , ( ) => true )
5456 . stub ( command , 'getToken' , getTokenCallback )
5557 . stdout ( )
@@ -60,6 +62,7 @@ describe('Migration Config validation', () => {
6062 . it ( 'throw error on Empty paths' ) ;
6163
6264 test
65+ . loadConfig ( { root : process . cwd ( ) } )
6366 . stub ( cliux , 'confirm' , ( ) => true )
6467 . stub ( command , 'getToken' , getTokenCallback )
6568 . stdout ( )
@@ -70,6 +73,7 @@ describe('Migration Config validation', () => {
7073 . it ( 'throw error on invalid config type' ) ;
7174
7275 test
76+ . loadConfig ( { root : process . cwd ( ) } )
7377 . stub ( cliux , 'confirm' , ( ) => true )
7478 . stdout ( )
7579 . command ( [
@@ -89,6 +93,7 @@ describe('Migration Config validation', () => {
8993 . it ( 'throw error on config without alias property' ) ;
9094
9195 test
96+ . loadConfig ( { root : process . cwd ( ) } )
9297 . stub ( cliux , 'confirm' , ( ) => true )
9398 . stub ( command , 'getToken' , getTokenCallback )
9499 . stdout ( )
@@ -111,6 +116,7 @@ describe('Migration Config validation', () => {
111116 . it ( 'throw error on invalidAlias' ) ;
112117
113118 test
119+ . loadConfig ( { root : process . cwd ( ) } )
114120 . stub ( cliux , 'confirm' , ( ) => true )
115121 . stub ( command , 'getToken' , getTokenCallback )
116122 . stdout ( )
@@ -269,6 +275,7 @@ describe('Content Type with Single RTE Field of Single Type', function () {
269275 } ) ;
270276
271277 test
278+ . loadConfig ( { root : process . cwd ( ) } )
272279 . stub ( cliux , 'confirm' , ( ) => 'yes' )
273280 . stub ( command , 'getToken' , getTokenCallback )
274281 . stdout ( )
@@ -278,6 +285,7 @@ describe('Content Type with Single RTE Field of Single Type', function () {
278285 } ) ;
279286
280287 test
288+ . loadConfig ( { root : process . cwd ( ) } )
281289 . stub ( cliux , 'confirm' , ( ) => 'yes' )
282290 . stub ( command , 'getToken' , getTokenCallback )
283291 . stdout ( )
@@ -287,6 +295,7 @@ describe('Content Type with Single RTE Field of Single Type', function () {
287295 } ) ;
288296
289297 test
298+ . loadConfig ( { root : process . cwd ( ) } )
290299 . stub ( cliux , 'confirm' , ( ) => 'yes' )
291300 . stub ( command , 'getToken' , getTokenCallback )
292301 . stdout ( )
@@ -295,6 +304,7 @@ describe('Content Type with Single RTE Field of Single Type', function () {
295304 expect ( ctx . stdout ) . to . contain ( 'Updated 1 Content Type(s) and 3 Entrie(s)' ) ;
296305 } ) ;
297306 test
307+ . loadConfig ( { root : process . cwd ( ) } )
298308 . stub ( cliux , 'confirm' , ( ) => 'yes' )
299309 . stub ( command , 'getToken' , getTokenCallback )
300310 . stdout ( )
@@ -316,6 +326,7 @@ describe('Content Type with Single RTE Field of Single Type', function () {
316326 } ) ;
317327
318328 test
329+ . loadConfig ( { root : process . cwd ( ) } )
319330 . stub ( cliux , 'confirm' , ( ) => 'yes' )
320331 . stub ( command , 'getToken' , getTokenCallback )
321332 . stdout ( )
@@ -338,6 +349,7 @@ describe('Content Type with Single RTE Field of Single Type', function () {
338349 expect ( ctx . stdout ) . to . contain ( 'Updated 1 Content Type(s) and 1 Entrie(s)' ) ;
339350 } ) ;
340351 test
352+ . loadConfig ( { root : process . cwd ( ) } )
341353 . stub ( cliux , 'confirm' , ( ) => 'yes' )
342354 . stub ( command , 'getToken' , getTokenCallback )
343355 . stdout ( )
@@ -361,6 +373,7 @@ describe('Content Type with Single RTE Field of Single Type', function () {
361373 . it ( 'throw error on invalid html rte path' ) ;
362374
363375 test
376+ . loadConfig ( { root : process . cwd ( ) } )
364377 . stub ( cliux , 'confirm' , ( ) => 'yes' )
365378 . stub ( command , 'getToken' , getTokenCallback )
366379 . stdout ( )
@@ -384,6 +397,7 @@ describe('Content Type with Single RTE Field of Single Type', function () {
384397 . it ( 'throw error on invalid html rte field schema' ) ;
385398
386399 test
400+ . loadConfig ( { root : process . cwd ( ) } )
387401 . stub ( cliux , 'confirm' , ( ) => 'yes' )
388402 . stub ( command , 'getToken' , getTokenCallback )
389403 . stdout ( )
@@ -406,6 +420,7 @@ describe('Content Type with Single RTE Field of Single Type', function () {
406420 } )
407421 . it ( 'throw error on invalid json rte field schema' ) ;
408422 test
423+ . loadConfig ( { root : process . cwd ( ) } )
409424 . stub ( cliux , 'confirm' , ( ) => 'yes' )
410425 . stub ( command , 'getToken' , getTokenCallback )
411426 . stdout ( )
@@ -429,6 +444,7 @@ describe('Content Type with Single RTE Field of Single Type', function () {
429444 . it ( 'throw error on invalid json rte path' ) ;
430445
431446 test
447+ . loadConfig ( { root : process . cwd ( ) } )
432448 . stub ( cliux , 'confirm' , ( ) => 'yes' )
433449 . stub ( command , 'getToken' , getTokenCallback )
434450 . stdout ( )
@@ -444,6 +460,7 @@ describe('Content Type with Single RTE Field of Single Type', function () {
444460 . it ( 'throw error on migration of Mutiple Html rte with single Json rte' ) ;
445461
446462 test
463+ . loadConfig ( { root : process . cwd ( ) } )
447464 . stub ( cliux , 'confirm' , ( ) => 'yes' )
448465 . stub ( command , 'getToken' , getTokenCallback )
449466 . stdout ( )
@@ -467,6 +484,7 @@ describe('Content Type with Single RTE Field of Single Type', function () {
467484 . it ( 'throw error on content type with empty schema' ) ;
468485
469486 test
487+ . loadConfig ( { root : process . cwd ( ) } )
470488 . stub ( cliux , 'confirm' , ( ) => 'yes' )
471489 . stub ( command , 'getToken' , getTokenCallback )
472490 . stdout ( )
@@ -492,6 +510,7 @@ describe('Content Type with Single RTE Field of Single Type', function () {
492510 . it ( 'throw error on different level rte migration' ) ;
493511
494512 test
513+ . loadConfig ( { root : process . cwd ( ) } )
495514 . stub ( cliux , 'confirm' , ( ) => true )
496515 . stub ( command , 'getToken' , getTokenCallback )
497516 . stdout ( )
@@ -514,6 +533,7 @@ describe('Content Type with Single RTE Field of Single Type', function () {
514533 . it ( 'throw error on invalid contenttype' ) ;
515534
516535 test
536+ . loadConfig ( { root : process . cwd ( ) } )
517537 . stub ( cliux , 'confirm' , ( ) => true )
518538 . stub ( command , 'getToken' , getTokenCallback )
519539 . stdout ( )
@@ -537,15 +557,20 @@ describe('Content Type with Single RTE Field of Single Type', function () {
537557 ) ;
538558 } ) ;
539559
540- test
560+ test
561+ . loadConfig ( { root : process . cwd ( ) } )
541562 . stub ( cliux , 'confirm' , ( ) => 'yes' )
542563 . stub ( command , 'getToken' , getTokenCallback )
543564 . stdout ( )
544- . command ( [ 'cm:entries:migrate-html-rte' , '--config-path' , './test/dummy/config/config-for-images-in-rte.json' , '--yes' ] )
565+ . command ( [
566+ 'cm:entries:migrate-html-rte' ,
567+ '--config-path' ,
568+ './test/dummy/config/config-for-images-in-rte.json' ,
569+ '--yes' ,
570+ ] )
545571 . it ( 'should have proper json structure for images migrated from HTML RTE' , ( ctx ) => {
546572 expect ( ctx . stdout ) . to . contain ( 'Updated 1 Content Type(s) and 1 Entrie(s)' ) ;
547573 } ) ;
548-
549574} ) ;
550575describe ( 'Global Field Migration' , ( ) => {
551576 let token = getToken ( 'test1' ) ;
@@ -574,6 +599,7 @@ describe('Global Field Migration', () => {
574599 type : 'management' ,
575600 } ) ;
576601 test
602+ . loadConfig ( { root : process . cwd ( ) } )
577603 . stub ( cliux , 'confirm' , ( ) => 'yes' )
578604 . stub ( command , 'getToken' , getTokenCallback )
579605 . stdout ( )
@@ -583,6 +609,7 @@ describe('Global Field Migration', () => {
583609 } ) ;
584610
585611 test
612+ . loadConfig ( { root : process . cwd ( ) } )
586613 . stub ( cliux , 'confirm' , ( ) => 'yes' )
587614 . stub ( command , 'getToken' , getTokenCallback )
588615 . stdout ( )
@@ -607,6 +634,7 @@ describe('Global Field Migration', () => {
607634 . it ( 'throw error on global field with empty referred content_types' ) ;
608635
609636 test
637+ . loadConfig ( { root : process . cwd ( ) } )
610638 . stub ( cliux , 'confirm' , ( ) => 'yes' )
611639 . stub ( command , 'getToken' , getTokenCallback )
612640 . stdout ( )
@@ -633,6 +661,7 @@ describe('Global Field Migration', () => {
633661 . it ( 'throw error on global field with invalid content_type' ) ;
634662
635663 test
664+ . loadConfig ( { root : process . cwd ( ) } )
636665 . stub ( cliux , 'confirm' , ( ) => 'yes' )
637666 . stub ( command , 'getToken' , getTokenCallback )
638667 . stdout ( )
@@ -657,6 +686,7 @@ describe('Global Field Migration', () => {
657686 . it ( 'throw error on global field with empty schema' ) ;
658687
659688 test
689+ . loadConfig ( { root : process . cwd ( ) } )
660690 . stub ( cliux , 'confirm' , ( ) => 'yes' )
661691 . stub ( command , 'getToken' , getTokenCallback )
662692 . stdout ( )
@@ -683,6 +713,7 @@ describe('Global Field Migration', () => {
683713 . it ( 'throw error on global field with empty schema content_type' ) ;
684714
685715 test
716+ . loadConfig ( { root : process . cwd ( ) } )
686717 . stub ( cliux , 'confirm' , ( ) => 'yes' )
687718 . stub ( command , 'getToken' , getTokenCallback )
688719 . stdout ( )
@@ -715,6 +746,7 @@ describe('Content Type with single rte of multiple type', () => {
715746 type : 'management' ,
716747 } ) ;
717748 test
749+ . loadConfig ( { root : process . cwd ( ) } )
718750 . stub ( cliux , 'confirm' , ( ) => 'yes' )
719751 . stub ( command , 'getToken' , getTokenCallback )
720752 . stdout ( )
@@ -732,6 +764,7 @@ describe('Content Type with Single RTE inside modular block', () => {
732764 type : 'management' ,
733765 } ) ;
734766 test
767+ . loadConfig ( { root : process . cwd ( ) } )
735768 . stub ( cliux , 'confirm' , ( ) => 'yes' )
736769 . stub ( command , 'getToken' , getTokenCallback )
737770 . stdout ( )
@@ -762,6 +795,7 @@ describe('Content Type with Single RTE of type multiple inside group', () => {
762795 type : 'management' ,
763796 } ) ;
764797 test
798+ . loadConfig ( { root : process . cwd ( ) } )
765799 . stub ( cliux , 'confirm' , ( ) => 'yes' )
766800 . stub ( command , 'getToken' , getTokenCallback )
767801 . stdout ( )
@@ -792,6 +826,7 @@ describe('Content Type with Single RTE inside group of type multiple', () => {
792826 type : 'management' ,
793827 } ) ;
794828 test
829+ . loadConfig ( { root : process . cwd ( ) } )
795830 . stub ( cliux , 'confirm' , ( ) => 'yes' )
796831 . stub ( command , 'getToken' , getTokenCallback )
797832 . stdout ( )
@@ -822,6 +857,7 @@ describe('Content Type with multiple file field', () => {
822857 type : 'management' ,
823858 } ) ;
824859 test
860+ . loadConfig ( { root : process . cwd ( ) } )
825861 . stub ( cliux , 'confirm' , ( ) => 'yes' )
826862 . stub ( command , 'getToken' , getTokenCallback )
827863 . stdout ( )
@@ -865,6 +901,7 @@ describe('Migration with old flags and command', () => {
865901 } ) ;
866902
867903 test
904+ . loadConfig ( { root : process . cwd ( ) } )
868905 . stub ( cliux , 'confirm' , ( ) => 'yes' )
869906 . stub ( command , 'getToken' , getTokenCallback )
870907 . stdout ( )
0 commit comments