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.
* chore: updates from devScripts * chore: snapshot * test: test what it says it's going to test * chore: bump core * style: remove comments --------- Co-authored-by: mshanemc <[email protected]>
- Loading branch information
1 parent
27ed803
commit 275dddd
Showing
5 changed files
with
186 additions
and
162 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
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 |
---|---|---|
|
@@ -32,21 +32,23 @@ describe('org:create:user', () => { | |
|
||
it('will properly merge fields regardless of capitalization', async () => { | ||
// notice the varied capitalization | ||
$$.SANDBOX.stub(fs.promises, 'readFile').resolves( | ||
JSON.stringify({ | ||
id: originalUserId, | ||
Username: '[email protected]', | ||
Alias: 'testAlias', | ||
Email: username, | ||
EmailEncodingKey: 'UTF-8', | ||
LanguageLocaleKey: 'en_US', | ||
localeSidKey: 'en_US', | ||
ProfileId: '00e2D000000bNexWWR', | ||
LastName: 'User', | ||
timeZoneSidKey: 'America/Los_Angeles', | ||
permsets: ['permset1', 'permset2'], | ||
}) | ||
); | ||
$$.SANDBOX.stub(fs.promises, 'readFile') | ||
.withArgs('testing') | ||
.resolves( | ||
JSON.stringify({ | ||
id: originalUserId, | ||
Username: '[email protected]', | ||
Alias: 'testAlias', | ||
Email: username, | ||
EmailEncodingKey: 'UTF-8', | ||
LanguageLocaleKey: 'en_US', | ||
localeSidKey: 'en_US', | ||
ProfileId: '00e2D000000bNexWWR', | ||
LastName: 'User', | ||
timeZoneSidKey: 'America/Los_Angeles', | ||
permsets: ['permset1', 'permset2'], | ||
}) | ||
); | ||
|
||
const createCommand = new CreateUserCommand(['-f', 'userConfig.json'], {} as Config); | ||
|
||
|
@@ -131,7 +133,11 @@ describe('org:create:user', () => { | |
if (readsFile) { | ||
$$.SANDBOXES.CONNECTION.stub(Connection.prototype, 'singleRecordQuery').resolves({ Id: '12345678' }); | ||
$$.SANDBOX.stub(Logger.prototype, 'debug'); | ||
$$.SANDBOX.stub(fs.promises, 'readFile').resolves(JSON.stringify(readsFile)); | ||
if (typeof readsFile !== 'boolean') { | ||
const fsStub = $$.SANDBOX.stub(fs.promises, 'readFile'); | ||
fsStub.withArgs('parent/child/file.json').resolves(JSON.stringify(readsFile)); | ||
fsStub.callThrough(); | ||
} | ||
} | ||
} | ||
|
||
|
@@ -151,7 +157,7 @@ describe('org:create:user', () => { | |
localesidkey: 'en_US', | ||
generatepassword: true, | ||
profileid: '12345678', | ||
profilename: 'profileFromArgs', | ||
profilename: 'profileFromFile', | ||
timezonesidkey: 'America/Los_Angeles', | ||
username: '[email protected]', | ||
}, | ||
|
@@ -163,6 +169,8 @@ describe('org:create:user', () => { | |
testOrg.username, | ||
'--target-dev-hub', | ||
'[email protected]', | ||
'--definition-file', | ||
'parent/child/file.json', | ||
"permsets='permCLI, permCLI2'", | ||
'generatepassword=true', | ||
], | ||
|
Oops, something went wrong.