generated from salesforcecli/plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from salesforcecli/wr/removeProfileQuery
fix: remove ProfileId query when we only need User Id
- Loading branch information
Showing
8 changed files
with
38 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"description": "displays information about a user of a scratch org", | ||
"description": "displays information about a user of a scratch org\nOutput includes the profile name, org ID, access token, instance URL, login URL, and alias if applicable.", | ||
"examples": ["sfdx force:user:display", "sfdx force:user:display -u [email protected] --json"], | ||
"accessTokenError": "This command doesn't accept an access token for a username.", | ||
"accessTokenAction": "Specify a username or an alias." | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"description": "list all authenticated users of an org", | ||
"description": "list all authenticated users of an org\nThe original scratch org admin is marked with \"(A)\"", | ||
"examples": [ | ||
"sfdx force:user:list", | ||
"sfdx force:user:list -u [email protected] --json", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"description": "generate a password for scratch org users", | ||
"description": "generate a password for scratch org users\nGenerates and sets a random password for one or more scratch org users. Targets the usernames listed with the --onbehalfof parameter or the --targetusername parameter. Defaults to the defaultusername.\n\nIf you haven’t set a default Dev Hub, or if your scratch org isn’t associated with your default Dev Hub, --targetdevhubusername is required.\n\nTo see a password that was previously generated, run \"sfdx force:user:display\".", | ||
"examples": [ | ||
"sfdx force:user:password:generate", | ||
"sfdx force:user:password:generate -u [email protected] --json", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ describe('force:user:password:generate', () => { | |
let authInfoStub: StubbedType<AuthInfo>; | ||
let authInfoConfigStub: StubbedType<AuthInfoConfig>; | ||
const testData = new MockTestOrgData(); | ||
let queryStub; | ||
|
||
async function prepareStubs(throws = false) { | ||
const authFields = await testData.getConfig(); | ||
|
@@ -32,8 +33,8 @@ describe('force:user:password:generate', () => { | |
stubMethod($$.SANDBOX, Org.prototype, 'getUsername').returns('[email protected]'); | ||
stubMethod($$.SANDBOX, Org.prototype, 'retrieveMaxApiVersion').returns('51.0'); | ||
stubMethod($$.SANDBOX, User, 'create').callsFake(async () => User.prototype); | ||
stubMethod($$.SANDBOX, User.prototype, 'retrieve').resolves({ | ||
id: '0052D0000043PawWWR', | ||
queryStub = stubMethod($$.SANDBOX, Connection.prototype, 'singleRecordQuery').resolves({ | ||
Id: '0052D0000043PawWWR', | ||
}); | ||
|
||
const secureBuffer: SecureBuffer<void> = new SecureBuffer<void>(); | ||
|
@@ -69,6 +70,7 @@ describe('force:user:password:generate', () => { | |
const result = JSON.parse(ctx.stdout).result; | ||
expect(result).to.deep.equal(expected); | ||
expect(authInfoStub.update.callCount).to.equal(2); | ||
expect(queryStub.callCount).to.equal(2); | ||
}); | ||
|
||
test | ||
|
@@ -80,6 +82,7 @@ describe('force:user:password:generate', () => { | |
const result = JSON.parse(ctx.stdout).result; | ||
expect(result).to.deep.equal(expected); | ||
expect(authInfoStub.update.callCount).to.equal(1); | ||
expect(queryStub.callCount).to.equal(1); | ||
}); | ||
|
||
test | ||
|
@@ -93,5 +96,6 @@ describe('force:user:password:generate', () => { | |
expect(result.status).to.equal(1); | ||
expect(result.name).to.equal('noSelfSetError'); | ||
expect(authInfoStub.update.callCount).to.equal(0); | ||
expect(queryStub.callCount).to.equal(1); | ||
}); | ||
}); |