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_MAKES: "getVehicleMakes",
|
||||||
GET_VEHICLE_MODELS: "getVehicleModels",
|
GET_VEHICLE_MODELS: "getVehicleModels",
|
||||||
GET_VEHICLE_STYLES: "getVehicleStyles",
|
GET_VEHICLE_STYLES: "getVehicleStyles",
|
||||||
GET_VEHICLE: "getVehicle",
|
SET_VEHICLE: "setVehicle",
|
||||||
GET_DAMAGE_OPTIONS: "getDamageOptions",
|
GET_DAMAGE_OPTIONS: "getDamageOptions",
|
||||||
GET_EVOX_IMAGE: "getEvoxImage",
|
GET_EVOX_IMAGE: "getEvoxImage",
|
||||||
LOOKUP_VEHICLE_BY_YMMS: "lookupVehicleByYmms",
|
LOOKUP_VEHICLE_BY_YMMS: "lookupVehicleByYmms",
|
||||||
|
|
|
||||||
|
|
@ -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"}]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -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"}]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -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"}]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,7 @@ describe("vehicle-style.vue", () => {
|
||||||
},
|
},
|
||||||
actionList: [
|
actionList: [
|
||||||
{
|
{
|
||||||
actionName: storeActions.GET_VEHICLE,
|
actionName: storeActions.SET_VEHICLE,
|
||||||
data: 'mockData'
|
data: 'mockData'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
@ -151,7 +151,7 @@ describe("vehicle-style.vue", () => {
|
||||||
|
|
||||||
//Act
|
//Act
|
||||||
vehicleStyle.beforeRouteEnter.call(wrapper.vm, { query: { fmgPage: "vehicle-style" } }, undefined, (c) => c(wrapper.vm));
|
vehicleStyle.beforeRouteEnter.call(wrapper.vm, { query: { fmgPage: "vehicle-style" } }, undefined, (c) => c(wrapper.vm));
|
||||||
wrapper.vm.selectVehicle();
|
wrapper.vm.setVehicle();
|
||||||
await nextTick();
|
await nextTick();
|
||||||
|
|
||||||
//Assert
|
//Assert
|
||||||
|
|
|
||||||
|
|
@ -68,16 +68,17 @@ export default {
|
||||||
// route to move backwards
|
// route to move backwards
|
||||||
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);
|
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);
|
||||||
},
|
},
|
||||||
selectVehicle() {
|
setVehicle() {
|
||||||
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});
|
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: {
|
watch: {
|
||||||
selectedStyle(style) {
|
selectedStyle(style) {
|
||||||
this.$store.commit(this.storeMutations.UPDATE_STYLE, style);
|
this.$store.commit(this.storeMutations.UPDATE_STYLE, style);
|
||||||
this.selectVehicle();
|
this.setVehicle().then(() => {
|
||||||
this.$router.navigate(this.navigationScenarios.SELECTED_STYLE, this.$route);
|
this.$router.navigate(this.navigationScenarios.SELECTED_STYLE, this.$route);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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"}]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ export default createStore({
|
||||||
payload: {},
|
payload: {},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getVehicle(context, {year, make, model, style}) {
|
setVehicle(context, {year, make, model, style}) {
|
||||||
return globalMethods.callHttpClient({
|
return globalMethods.callHttpClient({
|
||||||
methods: endpoints.GetVehicle.method,
|
methods: endpoints.GetVehicle.method,
|
||||||
endpoint: `${endpoints.GetVehicle.url}/${year}/${make}/${model}/${style}`,
|
endpoint: `${endpoints.GetVehicle.url}/${year}/${make}/${model}/${style}`,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue