diff --git a/test/commands/display.test.ts b/test/commands/display.test.ts index fffb938b..59f77c9b 100644 --- a/test/commands/display.test.ts +++ b/test/commands/display.test.ts @@ -11,7 +11,8 @@ import { expect } from 'chai'; import { DisplayUserCommand } from '../../src/commands/org/display/user.js'; const username = 'defaultusername@test.com'; - +const instanceUrl = 'https://instance.my.salesforce.com'; +const loginUrl = 'https://test.salesforce.com'; describe('org:display:user', () => { const $$ = new TestContext(); @@ -20,8 +21,8 @@ describe('org:display:user', () => { defaultOrg.orgId = 'abc123'; defaultOrg.username = 'defaultusername@test.com'; defaultOrg.userId = '1234567890'; - defaultOrg.instanceUrl = 'instanceURL'; - defaultOrg.loginUrl = 'login.test.com'; + defaultOrg.instanceUrl = instanceUrl; + defaultOrg.loginUrl = loginUrl; defaultOrg.password = '-a098u234/1!@#'; async function prepareStubs(queries = false) { @@ -36,8 +37,8 @@ describe('org:display:user', () => { { getFields: () => ({ username: 'defaultusername@test.com', - instanceUrl: 'instanceURL', - loginUrl: 'login.test.com', + instanceUrl, + loginUrl, }), } as AuthInfo, ]) @@ -56,8 +57,8 @@ describe('org:display:user', () => { username: 'defaultusername@test.com', userProfileName: 'profileName', userId: '1234567890', - instanceUrl: 'instanceURL', - loginUrl: 'login.test.com', + instanceUrl, + loginUrl, password: '-a098u234/1!@#', }), } as AuthInfo, @@ -73,8 +74,8 @@ describe('org:display:user', () => { accessToken: defaultOrg.accessToken, alias: 'testAlias', id: '1234567890', - instanceUrl: 'instanceURL', - loginUrl: 'login.test.com', + instanceUrl, + loginUrl, orgId: 'abc123', password: '-a098u234/1!@#', profileName: 'profileName', @@ -91,8 +92,8 @@ describe('org:display:user', () => { accessToken: defaultOrg.accessToken, alias: 'testAlias', id: 'QueriedId', - instanceUrl: 'instanceURL', - loginUrl: 'login.test.com', + instanceUrl, + loginUrl, orgId: 'abc123', profileName: 'QueriedName', username: defaultOrg.username, diff --git a/test/commands/list.test.ts b/test/commands/list.test.ts index 9b32278b..5d0f31e0 100644 --- a/test/commands/list.test.ts +++ b/test/commands/list.test.ts @@ -12,6 +12,9 @@ import { ListUsersCommand } from '../../src/commands/org/list/users.js'; const user1 = 'defaultusername@test.com'; const user2 = 'otherUser@test.com'; +const instanceUrl = 'https://instanceURL.com'; +const loginUrl = 'https://login.test.com'; + const expected = [ { defaultMarker: '(A)', @@ -20,8 +23,8 @@ const expected = [ profileName: 'System Administrator', orgId: 'abc123', accessToken: 'accessToken', - instanceUrl: 'instanceURL', - loginUrl: 'login.test.com', + instanceUrl, + loginUrl, userId: '0052D0000043PbGQAU', }, { @@ -31,8 +34,8 @@ const expected = [ profileName: 'System Administrator', orgId: 'abc123', accessToken: 'accessToken', - instanceUrl: 'instanceURL', - loginUrl: 'login.test.com', + instanceUrl, + loginUrl, userId: '0052D0000043PcBQAU', }, ]; @@ -45,8 +48,8 @@ describe('org:list:users', () => { user1Org.orgId = 'abc123'; user1Org.aliases = ['testAlias']; user1Org.accessToken = 'accessToken'; - user1Org.instanceUrl = 'instanceURL'; - user1Org.loginUrl = 'login.test.com'; + user1Org.instanceUrl = instanceUrl; + user1Org.loginUrl = loginUrl; user1Org.userId = '0052D0000043PbGQAU'; const user2Org = new MockTestOrgData(); @@ -54,8 +57,8 @@ describe('org:list:users', () => { user2Org.orgId = 'abc123'; user2Org.aliases = []; user2Org.accessToken = 'accessToken'; - user2Org.instanceUrl = 'instanceURL'; - user2Org.loginUrl = 'login.test.com'; + user2Org.instanceUrl = instanceUrl; + user2Org.loginUrl = loginUrl; user2Org.userId = '0052D0000043PcBQAU'; beforeEach(async () => { @@ -72,8 +75,8 @@ describe('org:list:users', () => { username: user1, userProfileName: 'profileName', userId: '1234567890', - instanceUrl: 'instanceURL', - loginUrl: 'login.test.com', + instanceUrl, + loginUrl, accessToken: 'accessToken', }), }, @@ -83,8 +86,8 @@ describe('org:list:users', () => { username: user2, userProfileName: 'profileName', userId: '1234567890', - instanceUrl: 'instanceURL', - loginUrl: 'login.test.com', + instanceUrl, + loginUrl, accessToken: 'accessToken', }), },