From b2f59c5f04c48165a6c71bf889f3f26277534778 Mon Sep 17 00:00:00 2001 From: Surbhi-sharma1 Date: Wed, 26 Jun 2024 22:19:26 +0530 Subject: [PATCH] fix(cli): resolve test cases resolve test case GH-2112 --- .../src/__tests__/suite/microservice-prompts.ts | 4 ++-- packages/cli/src/command-base.ts | 14 ++++---------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/packages/cli/src/__tests__/suite/microservice-prompts.ts b/packages/cli/src/__tests__/suite/microservice-prompts.ts index 433d5049b6..843f7809d7 100644 --- a/packages/cli/src/__tests__/suite/microservice-prompts.ts +++ b/packages/cli/src/__tests__/suite/microservice-prompts.ts @@ -82,7 +82,7 @@ export const microservicePromptsSuite = [ input: { name: 'baseService', message: 'Base ARC microservice', - type: 'list', + type: 'checkbox', choices: Object.values(SERVICES), }, output: SERVICES.AUTH, @@ -178,7 +178,7 @@ export const microservicePromptsSuite = [ input: { name: 'baseService', message: 'Base ARC microservice', - type: 'list', + type: 'checkbox', choices: Object.values(SERVICES), }, output: SERVICES.AUTH, diff --git a/packages/cli/src/command-base.ts b/packages/cli/src/command-base.ts index 3a6a4834b5..2f8831843a 100644 --- a/packages/cli/src/command-base.ts +++ b/packages/cli/src/command-base.ts @@ -162,22 +162,16 @@ export default abstract class CommandBase extends Command { if (flag.name === 'datasourceType') { response.type = 'list'; response.choices = flag.options; - } else if (flag.options.length > 1) { + } else if (flag.name === 'baseService') { response.type = 'checkbox'; - response.choices = flag.options.map(option => { - return { - name: option, - value: option, - }; - }); - } else { - response.type = 'list'; response.choices = flag.options; + } else { + // this is intentional. } } else { //do nothing - ``; } + return response; }