Skip to content

Commit 88fb2f1

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

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
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 & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -159,25 +159,17 @@ export default abstract class CommandBase<T extends object> extends Command {
159159
response.type = 'confirm';
160160
response.default = false;
161161
} else if (flag.options) {
162-
if (flag.name === 'datasourceType') {
163-
response.type = 'list';
164-
response.choices = flag.options;
165-
} else if (flag.options.length > 1) {
162+
if (flag.name === 'baseService') {
166163
response.type = 'checkbox';
167-
response.choices = flag.options.map(option => {
168-
return {
169-
name: option,
170-
value: option,
171-
};
172-
});
164+
response.choices = flag.options;
173165
} else {
174166
response.type = 'list';
175167
response.choices = flag.options;
176168
}
177169
} else {
178170
//do nothing
179-
``;
180171
}
172+
181173
return response;
182174
}
183175

0 commit comments

Comments
 (0)