Skip to content

Commit 4c29899

Browse files
fix(cli): resolve test cases
resolve test case GH-2112
1 parent 1e7c34a commit 4c29899

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

packages/cli/src/__tests__/suite/microservice-prompts.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export const microservicePromptsSuite = [
8282
input: {
8383
name: 'baseService',
8484
message: 'Base ARC microservice',
85-
type: 'list',
85+
type: 'checkbox',
8686
choices: Object.values(SERVICES),
8787
},
8888
output: SERVICES.AUTH,
@@ -178,7 +178,7 @@ export const microservicePromptsSuite = [
178178
input: {
179179
name: 'baseService',
180180
message: 'Base ARC microservice',
181-
type: 'list',
181+
type: 'checkbox',
182182
choices: Object.values(SERVICES),
183183
},
184184
output: SERVICES.AUTH,

packages/cli/src/command-base.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -162,22 +162,17 @@ export default abstract class CommandBase<T extends object> extends Command {
162162
if (flag.name === 'datasourceType') {
163163
response.type = 'list';
164164
response.choices = flag.options;
165-
} else if (flag.options.length > 1) {
165+
} else if (flag.name === 'baseService') {
166166
response.type = 'checkbox';
167-
response.choices = flag.options.map(option => {
168-
return {
169-
name: option,
170-
value: option,
171-
};
172-
});
167+
response.choices = flag.options;
173168
} else {
174169
response.type = 'list';
175170
response.choices = flag.options;
176171
}
177172
} else {
178173
//do nothing
179-
``;
180174
}
175+
181176
return response;
182177
}
183178

0 commit comments

Comments
 (0)