Merge pull request #142 from Safelite/remove-unneeded-data
Remove unneeded data
This commit is contained in:
commit
22d9ddd110
12 changed files with 25 additions and 28 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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"}]);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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"}]);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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"}]);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -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"}]);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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}`,
|
||||
|
|
|
|||
Loading…
Reference in a new issue