diff --git a/src/commands/env/list.ts b/src/commands/env/list.ts index 6efbdf0c..38f572b0 100644 --- a/src/commands/env/list.ts +++ b/src/commands/env/list.ts @@ -114,7 +114,7 @@ export default class EnvList extends Command { username: {}, orgId: { header: 'Org ID' }, instanceUrl: { header: 'Instance URL' }, - oauthMethod: { header: 'OAuth Method' }, + oauthMethod: { header: 'Auth Method' }, configs: { header: 'Config', get: (row: { configs?: string[] }) => (row.configs ? row.configs.join(', ') : ''), diff --git a/test/commands/env/list.test.ts b/test/commands/env/list.test.ts index dc34a689..60402c2d 100644 --- a/test/commands/env/list.test.ts +++ b/test/commands/env/list.test.ts @@ -28,6 +28,8 @@ const expectedSfOrgs = [ }, ]; +const expectedColumnNames = ['Aliases', 'Username', 'Org ID', 'Instance URL', 'Auth Method', 'Config']; + describe('list unit tests', () => { test .stub(AuthInfo, 'hasAuthentications', async (): Promise => true) @@ -46,6 +48,7 @@ describe('list unit tests', () => { .it('should fetch active orgs with human output', (ctx) => { const stdout = ctx.stdout; expect(stdout).to.be.ok; + expectedColumnNames.forEach((columnName) => expect(stdout).to.include(columnName)); expectedSfOrgs.forEach((sfOrg) => { expect(stdout).to.include(sfOrg.aliases); expect(stdout).to.include(sfOrg.orgId); @@ -62,6 +65,10 @@ describe('list unit tests', () => { .it('should fetch active orgs with human output and display selected columns', (ctx) => { const stdout = ctx.stdout; expect(stdout).to.be.ok; + ['Org ID', 'Username'].forEach((columnName) => expect(stdout).to.include(columnName)); + ['Aliases', 'Instance URL', 'Auth Method', 'Config'].forEach((columnName) => + expect(stdout).to.not.include(columnName) + ); expectedSfOrgs.forEach((sfOrg) => { expect(stdout).to.not.include(sfOrg.aliases); expect(stdout).to.include(sfOrg.orgId);