Skip to content

Commit

Permalink
pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
quinlanj committed Sep 28, 2021
1 parent c265ac0 commit 4b95b1d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class UseExistingGoogleServiceAccountKey {
const { chosenKey } = await promptAsync({
type: 'select',
name: 'chosenKey',
message: 'Select a Google Service Account Key.',
message: 'Select a Google Service Account Key:',
choices: sortedKeys.map(key => ({
title: this.formatGoogleServiceAccountKey(key),
value: key,
Expand All @@ -42,7 +42,7 @@ export class UseExistingGoogleServiceAccountKey {
return chosenKey;
}

sortGoogleServiceAccountKeysByUpdatedAtDesc(
private sortGoogleServiceAccountKeysByUpdatedAtDesc(
keys: GoogleServiceAccountKeyFragment[]
): GoogleServiceAccountKeyFragment[] {
return keys.sort(
Expand All @@ -51,11 +51,14 @@ export class UseExistingGoogleServiceAccountKey {
);
}

private formatGoogleServiceAccountKey(key: GoogleServiceAccountKeyFragment): string {
const { projectIdentifier, privateKeyIdentifier, clientEmail, clientIdentifier, updatedAt } =
key;
private formatGoogleServiceAccountKey({
projectIdentifier,
privateKeyIdentifier,
clientEmail,
clientIdentifier,
updatedAt,
}: GoogleServiceAccountKeyFragment): string {
let line: string = '';

line += `Client Email: ${clientEmail}, Project Id: ${projectIdentifier}`;
line += chalk.gray(
`\n Client Id: ${clientIdentifier}, Private Key Id: ${privateKeyIdentifier}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jest.mock('../../../../prompts');
asMock(promptAsync).mockImplementation(() => ({ chosenKey: testGoogleServiceAccountKeyFragment }));

describe(UseExistingGoogleServiceAccountKey, () => {
it('uses an existing an Google Service Account Key in Interactive Mode', async () => {
it('uses an existing Google Service Account Key in Interactive Mode', async () => {
const ctx = createCtxMock({
nonInteractive: false,
android: {
Expand Down

0 comments on commit 4b95b1d

Please sign in to comment.