Skip to content

Commit

Permalink
fix(cli): resolve test cases
Browse files Browse the repository at this point in the history
resolve test case

GH-2112
  • Loading branch information
Surbhi-sharma1 committed Jun 27, 2024
1 parent 1e7c34a commit 88fb2f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
4 changes: 2 additions & 2 deletions packages/cli/src/__tests__/suite/microservice-prompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
14 changes: 3 additions & 11 deletions packages/cli/src/command-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,25 +159,17 @@ export default abstract class CommandBase<T extends object> 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;
}

Expand Down

0 comments on commit 88fb2f1

Please sign in to comment.