Skip to content

Commit

Permalink
fix: rename column oauth method to auth method
Browse files Browse the repository at this point in the history
@W-9743986@
  • Loading branch information
peternhale committed Aug 12, 2021
1 parent e1dcfcb commit dba5399
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/commands/env/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(', ') : ''),
Expand Down
7 changes: 7 additions & 0 deletions test/commands/env/list.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean> => true)
Expand All @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit dba5399

Please sign in to comment.