File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed
Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ export class OrgOpenCommand extends SfdxCommand {
2222 path : flags . string ( {
2323 char : 'p' ,
2424 description : messages . getMessage ( 'cliPath' ) ,
25- default : '%2Flightning%2Fsetup' ,
2625 env : 'FORCE_OPEN_URL' ,
2726 parse : ( input ) => encodeURIComponent ( decodeURIComponent ( input ) ) ,
2827 } ) ,
@@ -34,7 +33,7 @@ export class OrgOpenCommand extends SfdxCommand {
3433
3534 public async run ( ) : Promise < OrgOpenOutput > {
3635 const frontDoorUrl = await this . buildFrontdoorUrl ( ) ;
37- const url = `${ frontDoorUrl } &retURL=${ this . flags . path as string } ` ;
36+ const url = this . flags . path ? `${ frontDoorUrl } &retURL=${ this . flags . path as string } ` : frontDoorUrl ;
3837 const orgId = this . org . getOrgId ( ) ;
3938 const username = this . org . getUsername ( ) ;
4039 const output = { orgId, url, username } ;
Original file line number Diff line number Diff line change 1717const testPath = '/lightning/whatever' ;
1818const testInstance = 'https://cs1.my.salesforce.com' ;
1919const accessToken = 'testAccessToken' ;
20-
21- const expectedUrl = `${ testInstance } /secur/frontdoor.jsp?sid= ${ accessToken } &retURL=${ encodeURIComponent ( testPath ) } ` ;
20+ const expectedDefaultUrl = ` ${ testInstance } /secur/frontdoor.jsp?sid= ${ accessToken } ` ;
21+ const expectedUrl = `${ expectedDefaultUrl } &retURL=${ encodeURIComponent ( testPath ) } ` ;
2222
2323const testJsonStructure = ( response : object ) => {
2424 expect ( response ) . to . have . property ( 'url' ) ;
@@ -52,9 +52,7 @@ describe('open commands', () => {
5252 const response = JSON . parse ( ctx . stdout ) ;
5353 expect ( response . status ) . to . equal ( 0 ) ;
5454 expect ( testJsonStructure ( response . result ) ) . to . be . true ;
55- expect ( response . result . url ) . to . equal (
56- `${ testInstance } /secur/frontdoor.jsp?sid=${ accessToken } &retURL=${ encodeURIComponent ( '/lightning/setup' ) } `
57- ) ;
55+ expect ( response . result . url ) . to . equal ( expectedDefaultUrl ) ;
5856 } ) ;
5957
6058 test
You can’t perform that action at this time.
0 commit comments