From c34ed644dd86860df095e457dc720bb79d5711b4 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, 5 insertions(+), 13 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..59491aa9ef 100644 --- a/packages/cli/src/command-base.ts +++ b/packages/cli/src/command-base.ts @@ -159,25 +159,17 @@ export default abstract class CommandBase extends Command { response.type = 'confirm'; response.default = false; } else if (flag.options) { - if (flag.name === 'datasourceType') { - response.type = 'list'; - response.choices = flag.options; - } else if (flag.options.length > 1) { + if (flag.name === 'baseService') { response.type = 'checkbox'; - response.choices = flag.options.map(option => { - return { - name: option, - value: option, - }; - }); + response.choices = flag.options; } else { response.type = 'list'; response.choices = flag.options; } } else { //do nothing - ``; } + return response; }