Merge branch 'develop' into feature/CSR-258

This commit is contained in:
CarlNation 2022-01-13 13:18:35 -05:00
commit 950ad67c16
12 changed files with 25 additions and 28 deletions

View file

@ -5,7 +5,7 @@ const storeActions = {
GET_VEHICLE_MAKES: "getVehicleMakes",
GET_VEHICLE_MODELS: "getVehicleModels",
GET_VEHICLE_STYLES: "getVehicleStyles",
GET_VEHICLE: "getVehicle",
SET_VEHICLE: "setVehicle",
GET_DAMAGE_OPTIONS: "getDamageOptions",
GET_EVOX_IMAGE: "getEvoxImage",
LOOKUP_VEHICLE_BY_YMMS: "lookupVehicleByYmms",

View file

@ -12,11 +12,11 @@ describe("make-question.vue", () => {
const makeToSelect = "ford";
//Act
wrapper.setData({ selectedMake: makeToSelect });
wrapper.setValue({ selectedMake: makeToSelect });
await wrapper.vm.$nextTick();
//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"
:answers="makes"
groupName="Choose Vehicle Make"
v-model="selectedMake"
v-model="modelValue"
/>
</template>
@ -19,7 +19,6 @@ export default {
data() {
return {
questionText: null,
selectedMake: null,
makes: Array,
}
},
@ -39,7 +38,7 @@ export default {
}
},
watch: {
selectedMake(val) {
modelValue(val) {
this.$emit("update:modelValue", val);
}
},

View file

@ -12,11 +12,11 @@ describe("model-question.vue", () => {
const modelToSelect = "Civic";
//Act
wrapper.setData({ selectedModel: modelToSelect });
wrapper.setValue({ selectedModel: modelToSelect });
await wrapper.vm.$nextTick();
//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"
:answers="models"
groupName="Choose Vehicle Model"
v-model="selectedModel"
v-model="modelValue"
/>
</template>
@ -19,7 +19,6 @@ export default {
data() {
return {
questionText: null,
selectedModel: null,
models: Array,
}
},
@ -39,7 +38,7 @@ export default {
}
},
watch: {
selectedModel(val) {
modelValue(val) {
this.$emit("update:modelValue", val);
}
},

View file

@ -12,11 +12,11 @@ describe("style-question.vue", () => {
const styleToSelect = "4 Door";
//Act
wrapper.setData({ selectedStyle: styleToSelect });
wrapper.setValue({ selectedStyle: styleToSelect });
await wrapper.vm.$nextTick();
//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"
:answers="styles"
groupName="Choose Vehicle Style"
v-model="selectedStyle"
v-model="modelValue"
/>
</template>
@ -19,7 +19,6 @@ export default {
data() {
return {
questionText: null,
selectedStyle: null,
styles: Array,
}
},
@ -39,7 +38,7 @@ export default {
}
},
watch: {
selectedStyle(val) {
modelValue(val) {
this.$emit("update:modelValue", val);
}
},

View file

@ -142,7 +142,7 @@ describe("vehicle-style.vue", () => {
},
actionList: [
{
actionName: storeActions.GET_VEHICLE,
actionName: storeActions.SET_VEHICLE,
data: 'mockData'
}
]
@ -151,7 +151,7 @@ describe("vehicle-style.vue", () => {
//Act
vehicleStyle.beforeRouteEnter.call(wrapper.vm, { query: { fmgPage: "vehicle-style" } }, undefined, (c) => c(wrapper.vm));
wrapper.vm.selectVehicle();
wrapper.vm.setVehicle();
await nextTick();
//Assert

View file

@ -68,16 +68,17 @@ export default {
// route to move backwards
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);
},
selectVehicle() {
this.dispatchNonBlockingStoreAction(this.storeActions.GET_VEHICLE, {year: this.$store.getters.vehicle.year, make: this.$store.getters.vehicle.make, model: this.$store.getters.vehicle.model, style: this.$store.getters.vehicle.style});
setVehicle() {
return this.dispatchNonBlockingStoreAction(this.storeActions.SET_VEHICLE, {year: this.$store.getters.vehicle.year, make: this.$store.getters.vehicle.make, model: this.$store.getters.vehicle.model, style: this.$store.getters.vehicle.style});
}
},
watch: {
selectedStyle(style) {
this.$store.commit(this.storeMutations.UPDATE_STYLE, style);
this.selectVehicle();
this.$router.navigate(this.navigationScenarios.SELECTED_STYLE, this.$route);
this.setVehicle().then(() => {
this.$router.navigate(this.navigationScenarios.SELECTED_STYLE, this.$route);
});
}
},

View file

@ -12,11 +12,11 @@ describe("year-question.vue", () => {
const yearToSelect = "2021";
//Act
wrapper.setData({ selectedYear: yearToSelect });
wrapper.setValue({ modelValue: yearToSelect });
await wrapper.vm.$nextTick();
//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"
:answers="years"
groupName="Choose Vehicle Year"
v-model="selectedYear"
v-model="modelValue"
/>
</template>
@ -18,7 +18,6 @@ export default {
data() {
return {
questionText: null,
selectedYear: null,
years: Array,
}
},
@ -38,7 +37,7 @@ export default {
}
},
watch: {
selectedYear(val) {
modelValue(val) {
this.$emit("update:modelValue", val);
}
},

View file

@ -129,7 +129,7 @@ export default createStore({
payload: {},
});
},
getVehicle(context, {year, make, model, style}) {
setVehicle(context, {year, make, model, style}) {
return globalMethods.callHttpClient({
methods: endpoints.GetVehicle.method,
endpoint: `${endpoints.GetVehicle.url}/${year}/${make}/${model}/${style}`,