@@ -39,7 +39,9 @@ describe('Export to CSV functionality', () => {
3939 nock ( cma )
4040 . get ( `/v3/taxonomies/${ mockData . taxonomiesResp . taxonomies [ 0 ] . uid } ` )
4141 . reply ( 200 , { taxonomy : mockData . taxonomiesResp . taxonomies [ 0 ] } )
42- . get ( `/v3/taxonomies/${ mockData . taxonomiesResp . taxonomies [ 0 ] . uid } /export?format=csv&locale=en-us&include_fallback=true&fallback_locale=en-us` )
42+ . get (
43+ `/v3/taxonomies/${ mockData . taxonomiesResp . taxonomies [ 0 ] . uid } /export?format=csv&locale=en-us&include_fallback=true&fallback_locale=en-us` ,
44+ )
4345 . reply ( 200 , mockData . taxonomyCSVData ) ;
4446
4547 const { stdout } = await runCommand ( [
@@ -63,11 +65,17 @@ describe('Export to CSV functionality', () => {
6365
6466 it ( 'CSV file should be created without taxonomy uid and with locale parameters' , async ( ) => {
6567 nock ( cma )
66- . get ( '/v3/taxonomies?include_count=true&limit=100&skip=0&locale=en-us&include_fallback=true&fallback_locale=en-us' )
68+ . get (
69+ '/v3/taxonomies?include_count=true&limit=100&skip=0&locale=en-us&include_fallback=true&fallback_locale=en-us' ,
70+ )
6771 . reply ( 200 , mockData . taxonomiesResp )
68- . get ( `/v3/taxonomies/${ mockData . taxonomiesResp . taxonomies [ 0 ] . uid } /export?format=csv&locale=en-us&include_fallback=true&fallback_locale=en-us` )
72+ . get (
73+ `/v3/taxonomies/${ mockData . taxonomiesResp . taxonomies [ 0 ] . uid } /export?format=csv&locale=en-us&include_fallback=true&fallback_locale=en-us` ,
74+ )
6975 . reply ( 200 , mockData . taxonomyCSVData )
70- . get ( `/v3/taxonomies/${ mockData . taxonomiesResp . taxonomies [ 1 ] . uid } /export?format=csv&locale=en-us&include_fallback=true&fallback_locale=en-us` )
76+ . get (
77+ `/v3/taxonomies/${ mockData . taxonomiesResp . taxonomies [ 1 ] . uid } /export?format=csv&locale=en-us&include_fallback=true&fallback_locale=en-us` ,
78+ )
7179 . reply ( 200 , mockData . taxonomyCSVData ) ;
7280
7381 const { stdout } = await runCommand ( [
@@ -86,37 +94,6 @@ describe('Export to CSV functionality', () => {
8694 ] ) ;
8795 expect ( stdout ) . to . include ( 'Writing taxonomies to file:' ) ;
8896 } ) ;
89-
90- it ( 'CSV file should be created using prompt with fallback options' , async ( ) => {
91- nock ( cma )
92- . get ( `/v3/organizations?limit=100` )
93- . reply ( 200 , { organizations : mockData . organizations } )
94- . get ( `/v3/stacks?&query={"org_uid":"${ mockData . organizations [ 0 ] . uid } "}` )
95- . reply ( 200 , { stacks : mockData . stacks } )
96- . get ( '/v3/locales' )
97- . reply ( 200 , { locales : mockData . locales } )
98- . get ( `/v3/taxonomies/${ mockData . taxonomiesResp . taxonomies [ 0 ] . uid } ` )
99- . reply ( 200 , { taxonomy : mockData . taxonomiesResp . taxonomies [ 0 ] } )
100- . get ( `/v3/taxonomies/${ mockData . taxonomiesResp . taxonomies [ 0 ] . uid } /export?format=csv&locale=en-us&include_fallback=true&fallback_locale=en-us` )
101- . reply ( 200 , mockData . taxonomyCSVData ) ;
102-
103- sandbox . stub ( process , 'chdir' ) . returns ( undefined ) ;
104- sandbox . stub ( inquirer , 'registerPrompt' ) . returns ( undefined ) ;
105- sandbox . stub ( inquirer , 'prompt' ) . returns (
106- Promise . resolve ( {
107- action : 'taxonomies' ,
108- chosenOrg : mockData . organizations [ 0 ] . name ,
109- chosenStack : mockData . stacks [ 0 ] . name ,
110- chosenLanguage : 'en-us' ,
111- includeFallback : true ,
112- selectedFallbackLocale : 'en-us' ,
113- } ) ,
114- ) ;
115-
116- const { stdout } = await runCommand ( [ 'cm:export-to-csv' , '--taxonomy-uid' , 'taxonomy_uid_1' ] ) ;
117- //expect(stdout).to.include('Writing taxonomies to file');
118- sandbox . restore ( ) ;
119- } ) ;
12097 } ) ;
12198
12299 describe ( 'Export entries' , ( ) => {
0 commit comments