@@ -33,6 +33,30 @@ describe('webapp retrieve', () => {
3333 it ( 'retrieves webapp with required name flag' , async ( ) => {
3434 const result = await WebappRetrieve . run ( [ '--name' , 'myWebApp' ] ) ;
3535 expect ( result . name ) . to . equal ( 'myWebApp' ) ;
36+ expect ( result . noOverwrite ) . to . be . false ;
37+ expect ( result . ignore ) . to . be . undefined ;
38+ expect ( result . success ) . to . be . true ;
39+ } ) ;
40+
41+ it ( 'retrieves webapp with no-overwrite flag' , async ( ) => {
42+ const result = await WebappRetrieve . run ( [ '--name' , 'myWebApp' , '--no-overwrite' ] ) ;
43+ expect ( result . name ) . to . equal ( 'myWebApp' ) ;
44+ expect ( result . noOverwrite ) . to . be . true ;
45+ expect ( result . success ) . to . be . true ;
46+ } ) ;
47+
48+ it ( 'retrieves webapp with ignore pattern' , async ( ) => {
49+ const result = await WebappRetrieve . run ( [ '--name' , 'myWebApp' , '--ignore' , 'dist/**' ] ) ;
50+ expect ( result . name ) . to . equal ( 'myWebApp' ) ;
51+ expect ( result . ignore ) . to . equal ( 'dist/**' ) ;
52+ expect ( result . success ) . to . be . true ;
53+ } ) ;
54+
55+ it ( 'retrieves webapp with both no-overwrite and ignore flags' , async ( ) => {
56+ const result = await WebappRetrieve . run ( [ '--name' , 'myWebApp' , '--no-overwrite' , '--ignore' , 'dist/**' ] ) ;
57+ expect ( result . name ) . to . equal ( 'myWebApp' ) ;
58+ expect ( result . noOverwrite ) . to . be . true ;
59+ expect ( result . ignore ) . to . equal ( 'dist/**' ) ;
3660 expect ( result . success ) . to . be . true ;
3761 } ) ;
3862
@@ -51,4 +75,22 @@ describe('webapp retrieve', () => {
5175 expect ( output ) . to . include ( 'Retrieving web app: myWebApp' ) ;
5276 expect ( output ) . to . include ( 'Successfully retrieved myWebApp' ) ;
5377 } ) ;
78+
79+ it ( 'outputs overwrite protection message' , async ( ) => {
80+ await WebappRetrieve . run ( [ '--name' , 'myWebApp' , '--no-overwrite' ] ) ;
81+ const output = sfCommandStubs . log
82+ . getCalls ( )
83+ . flatMap ( ( c ) => c . args )
84+ . join ( '\n' ) ;
85+ expect ( output ) . to . include ( 'Overwrite protection enabled' ) ;
86+ } ) ;
87+
88+ it ( 'outputs ignore pattern message' , async ( ) => {
89+ await WebappRetrieve . run ( [ '--name' , 'myWebApp' , '--ignore' , 'dist/**' ] ) ;
90+ const output = sfCommandStubs . log
91+ . getCalls ( )
92+ . flatMap ( ( c ) => c . args )
93+ . join ( '\n' ) ;
94+ expect ( output ) . to . include ( 'Ignoring pattern: dist/**' ) ;
95+ } ) ;
5496} ) ;
0 commit comments