Removing unneeded data from vehicle question vue files

This commit is contained in:
Max 2022-01-13 11:32:04 -05:00
parent f28e4fb4ea
commit 8e59a8d746
8 changed files with 16 additions and 20 deletions

View file

@ -12,11 +12,11 @@ describe("make-question.vue", () => {
const makeToSelect = "ford"; const makeToSelect = "ford";
//Act //Act
wrapper.setData({ selectedMake: makeToSelect }); wrapper.setValue({ selectedMake: makeToSelect });
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
//Assert //Assert
expect(wrapper.emitted()["update:modelValue"][0]).toEqual(["ford"]); expect(wrapper.emitted()["update:modelValue"][0]).toEqual([{selectedMake: "ford"}]);
}); });
}); });

View file

@ -3,7 +3,7 @@
:questionText="questionText" :questionText="questionText"
:answers="makes" :answers="makes"
groupName="Choose Vehicle Make" groupName="Choose Vehicle Make"
v-model="selectedMake" v-model="modelValue"
/> />
</template> </template>
@ -19,7 +19,6 @@ export default {
data() { data() {
return { return {
questionText: null, questionText: null,
selectedMake: null,
makes: Array, makes: Array,
} }
}, },
@ -39,7 +38,7 @@ export default {
} }
}, },
watch: { watch: {
selectedMake(val) { modelValue(val) {
this.$emit("update:modelValue", val); this.$emit("update:modelValue", val);
} }
}, },

View file

@ -12,11 +12,11 @@ describe("model-question.vue", () => {
const modelToSelect = "Civic"; const modelToSelect = "Civic";
//Act //Act
wrapper.setData({ selectedModel: modelToSelect }); wrapper.setValue({ selectedModel: modelToSelect });
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
//Assert //Assert
expect(wrapper.emitted()["update:modelValue"][0]).toEqual(["Civic"]); expect(wrapper.emitted()["update:modelValue"][0]).toEqual([{selectedModel: "Civic"}]);
}); });
}); });

View file

@ -3,7 +3,7 @@
:questionText="questionText" :questionText="questionText"
:answers="models" :answers="models"
groupName="Choose Vehicle Model" groupName="Choose Vehicle Model"
v-model="selectedModel" v-model="modelValue"
/> />
</template> </template>
@ -19,7 +19,6 @@ export default {
data() { data() {
return { return {
questionText: null, questionText: null,
selectedModel: null,
models: Array, models: Array,
} }
}, },
@ -39,7 +38,7 @@ export default {
} }
}, },
watch: { watch: {
selectedModel(val) { modelValue(val) {
this.$emit("update:modelValue", val); this.$emit("update:modelValue", val);
} }
}, },

View file

@ -12,11 +12,11 @@ describe("style-question.vue", () => {
const styleToSelect = "4 Door"; const styleToSelect = "4 Door";
//Act //Act
wrapper.setData({ selectedStyle: styleToSelect }); wrapper.setValue({ selectedStyle: styleToSelect });
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
//Assert //Assert
expect(wrapper.emitted()["update:modelValue"][0]).toEqual(["4 Door"]); expect(wrapper.emitted()["update:modelValue"][0]).toEqual([{selectedStyle: "4 Door"}]);
}); });
}); });

View file

@ -3,7 +3,7 @@
:questionText="questionText" :questionText="questionText"
:answers="styles" :answers="styles"
groupName="Choose Vehicle Style" groupName="Choose Vehicle Style"
v-model="selectedStyle" v-model="modelValue"
/> />
</template> </template>
@ -19,7 +19,6 @@ export default {
data() { data() {
return { return {
questionText: null, questionText: null,
selectedStyle: null,
styles: Array, styles: Array,
} }
}, },
@ -39,7 +38,7 @@ export default {
} }
}, },
watch: { watch: {
selectedStyle(val) { modelValue(val) {
this.$emit("update:modelValue", val); this.$emit("update:modelValue", val);
} }
}, },

View file

@ -12,11 +12,11 @@ describe("year-question.vue", () => {
const yearToSelect = "2021"; const yearToSelect = "2021";
//Act //Act
wrapper.setData({ selectedYear: yearToSelect }); wrapper.setValue({ modelValue: yearToSelect });
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
//Assert //Assert
expect(wrapper.emitted()["update:modelValue"][0]).toEqual(["2021"]); expect(wrapper.emitted()["update:modelValue"][0]).toEqual([{modelValue: "2021"}]);
}); });
}); });

View file

@ -3,7 +3,7 @@
:questionText="questionText" :questionText="questionText"
:answers="years" :answers="years"
groupName="Choose Vehicle Year" groupName="Choose Vehicle Year"
v-model="selectedYear" v-model="modelValue"
/> />
</template> </template>
@ -18,7 +18,6 @@ export default {
data() { data() {
return { return {
questionText: null, questionText: null,
selectedYear: null,
years: Array, years: Array,
} }
}, },
@ -38,7 +37,7 @@ export default {
} }
}, },
watch: { watch: {
selectedYear(val) { modelValue(val) {
this.$emit("update:modelValue", val); this.$emit("update:modelValue", val);
} }
}, },