diff --git a/frontend/src/App.vue b/frontend/src/App.vue
index 67ce17f6..47f7ec24 100644
--- a/frontend/src/App.vue
+++ b/frontend/src/App.vue
@@ -171,6 +171,7 @@ export default {
return p.then(() => that.updateQuestion(question)).catch(error => {
// eslint-disable-next-line no-console
console.error(error);
+ // TODO: add information to log in case a question failed and there is a list/rawlist question without selected value
})
}, Promise.resolve());
@@ -238,9 +239,7 @@ export default {
"validate"
]);
question.isValid = _.isString(response) ? false : response;
- question.validationMessage = _.isString(response)
- ? response
- : undefined;
+ question.validationMessage = _.isString(response) ? response : undefined;
}
}
},
diff --git a/frontend/src/components/QuestionTypes/QuestionList.vue b/frontend/src/components/QuestionTypes/QuestionList.vue
index 27a6af63..734fba22 100644
--- a/frontend/src/components/QuestionTypes/QuestionList.vue
+++ b/frontend/src/components/QuestionTypes/QuestionList.vue
@@ -2,7 +2,8 @@
{{currentQuestion.message}}
{
updateQuestionsFromIndex: () => {}
})
- expect(wrapper.vm.default).toBe('testName1')
+ expect(wrapper.vm.default).toBeUndefined()
})
test('default is undefined and choices are strings', () => {
@@ -77,7 +77,7 @@ describe('QuestionList.vue', () => {
updateQuestionsFromIndex: () => {}
})
- expect(wrapper.vm.default).toBe('testName1')
+ expect(wrapper.vm.default).toBeUndefined()
})
test('change selected', async () => {
diff --git a/generator-foodq/generators/app/index.js b/generator-foodq/generators/app/index.js
index f82b29ef..eed67776 100644
--- a/generator-foodq/generators/app/index.js
+++ b/generator-foodq/generators/app/index.js
@@ -128,7 +128,6 @@ module.exports = class extends Generator {
type: "list",
name: "hungerLevel",
message: "How hungry are you?",
- default: 1,
choices: () => [
{ name: "Very hungry" },
{ name: "A bit hungry" },
@@ -164,7 +163,7 @@ module.exports = class extends Generator {
name: 'enjoy',
message: 'Did you enjoy your meal?',
default: (answers) => {
- return (answers.hungerLevel === "A bit hungry" ? "ok" : "michelin");
+ return (answers.hungerLevel.toString() === "A bit hungry" ? "ok" : "michelin");
},
choices: [
{ name: 'Not at all', value: 'no' },