Merge branch 'develop' into feature/CSR-1115
This commit is contained in:
commit
cecaf10f92
3 changed files with 53 additions and 48 deletions
|
|
@ -71,7 +71,8 @@
|
|||
<shopQuestion
|
||||
ref="shopQuestion"
|
||||
v-show="isShopQuestionDisplayed"
|
||||
v-model="selectedProvider"
|
||||
v-model="selectedProviderNumber"
|
||||
@providerSelected="onProviderSelected"
|
||||
:serviceZipCode="zipCode"
|
||||
:selectedAppointmentType="selectedAppointmentType"
|
||||
:isDisplayed="isShopQuestionDisplayed"
|
||||
|
|
@ -133,6 +134,14 @@ defineRule("mobile-location-required", (value) => {
|
|||
return true;
|
||||
});
|
||||
|
||||
const defaultProvider = {
|
||||
providerNumber: null,
|
||||
address: null,
|
||||
city: null,
|
||||
state: null,
|
||||
zip: null,
|
||||
};
|
||||
|
||||
export default {
|
||||
name: "service-location",
|
||||
data() {
|
||||
|
|
@ -148,7 +157,8 @@ export default {
|
|||
isGlassServiceableMobile: null,
|
||||
isRecalibrationServiceableMobile: null,
|
||||
selectedAppointmentType: null,
|
||||
selectedProvider: null,
|
||||
selectedProvider: this.getSelectedProvider(),
|
||||
selectedProviderNumber: this.getSelectedProvider().providerNumber,
|
||||
mobileFeePart: null,
|
||||
zipContainsMilitaryBase: false,
|
||||
};
|
||||
|
|
@ -215,7 +225,7 @@ export default {
|
|||
if (newValue.zipCode !== this.zipCode) {
|
||||
this.resetMobileLocation();
|
||||
this.selectedAppointmentType = null;
|
||||
this.selectedProvider = null;
|
||||
this.selectedProvider = defaultProvider;
|
||||
}
|
||||
|
||||
this.state = newValue.state;
|
||||
|
|
@ -250,7 +260,7 @@ export default {
|
|||
if (!this.selectedAppointmentType == "Mobile") {
|
||||
this.selectedAppointmentType = null;
|
||||
}
|
||||
this.selectedProvider = null;
|
||||
this.selectedProvider = defaultProvider;
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
@ -340,6 +350,9 @@ export default {
|
|||
getServiceZipCodeFromStore() {
|
||||
return store.getters.order.serviceLocation.zipCode;
|
||||
},
|
||||
getSelectedProvider() {
|
||||
return store.getters.order.serviceLocation.provider ?? defaultProvider;
|
||||
},
|
||||
setMobileFeePart(mobileFeePart) {
|
||||
this.mobileFeePart = mobileFeePart;
|
||||
},
|
||||
|
|
@ -373,6 +386,9 @@ export default {
|
|||
async reloadShopData() {
|
||||
await this.$refs.shopQuestion.reloadShopData(this.zipCode);
|
||||
},
|
||||
onProviderSelected(selectedProvider) {
|
||||
this.selectedProvider = selectedProvider;
|
||||
},
|
||||
},
|
||||
components: {
|
||||
alert,
|
||||
|
|
|
|||
|
|
@ -157,17 +157,7 @@ describe("shop-question.vue", () => {
|
|||
const { wrapper } = setupMocks({
|
||||
mixins: [mockMixin],
|
||||
props: {
|
||||
modelValue: {
|
||||
address: {
|
||||
city: "POWELL",
|
||||
country: "US",
|
||||
state: "OH",
|
||||
streetAddress: "3938 POWELL RD",
|
||||
zipCode: "43065",
|
||||
},
|
||||
distanceInMiles: 16.2690495685233,
|
||||
providerNumber: null,
|
||||
},
|
||||
modelValue: null,
|
||||
serviceZipCode: "43081",
|
||||
selectedAppointmentType: "Dropoff",
|
||||
cmsWidgetName: cmsWidgetName,
|
||||
|
|
@ -435,41 +425,35 @@ describe("shop-question.vue", () => {
|
|||
]);
|
||||
});
|
||||
|
||||
// it("Should display the number of shops necessary to show a previously selected shop", async () => {
|
||||
// // Arrange
|
||||
// const { wrapper } = setupMocks({
|
||||
// mixins: [mockMixin],
|
||||
// props: {
|
||||
// modelValue: {
|
||||
// address: {
|
||||
// city: "POWELL",
|
||||
// country: "US",
|
||||
// state: "OH",
|
||||
// streetAddress: "3938 POWELL RD",
|
||||
// zipCode: "43065",
|
||||
// },
|
||||
// distanceInMiles: 16.2690495685233,
|
||||
// providerNumber: "003341",
|
||||
// },
|
||||
// serviceZipCode: "43081",
|
||||
// selectedAppointmentType: "Dropoff",
|
||||
// cmsWidgetName: cmsWidgetName,
|
||||
// },
|
||||
// mountOptions: {
|
||||
// attachTo: document.body,
|
||||
// },
|
||||
// });
|
||||
it("Should display the number of shops necessary to show a previously selected shop", async () => {
|
||||
// Arrange
|
||||
const selectedProvider = {
|
||||
providerNumber: "003341",
|
||||
};
|
||||
|
||||
// // Act
|
||||
// wrapper.vm.initializeComponent(shopQuestionInitialData);
|
||||
const { wrapper } = setupMocks({
|
||||
mixins: [mockMixin],
|
||||
props: {
|
||||
modelValue: selectedProvider.providerNumber,
|
||||
serviceZipCode: "43081",
|
||||
selectedAppointmentType: "Dropoff",
|
||||
cmsWidgetName: cmsWidgetName,
|
||||
},
|
||||
mountOptions: {
|
||||
attachTo: document.body,
|
||||
},
|
||||
});
|
||||
|
||||
// await wrapper.vm.$nextTick();
|
||||
// await wrapper.vm.$nextTick();
|
||||
// await wrapper.vm.$nextTick();
|
||||
// Act
|
||||
wrapper.vm.initializeComponent(shopQuestionInitialData);
|
||||
|
||||
// // Assert
|
||||
// expect(wrapper.vm.answers.length).toEqual(5);
|
||||
// });
|
||||
await wrapper.vm.$nextTick();
|
||||
await wrapper.vm.$nextTick();
|
||||
await wrapper.vm.$nextTick();
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.answers.length).toEqual(5);
|
||||
});
|
||||
|
||||
it("Should reset the answers when the selected appointment type changes", async () => {
|
||||
// Arrange
|
||||
|
|
|
|||
|
|
@ -89,7 +89,8 @@ export default {
|
|||
(provider) => provider.providerNumber == newValue
|
||||
);
|
||||
|
||||
this.$emit("update:modelValue", provider);
|
||||
this.$emit("update:modelValue", newValue);
|
||||
this.$emit("providerSelected", provider);
|
||||
},
|
||||
},
|
||||
displayDropoffInformation() {
|
||||
|
|
@ -170,6 +171,10 @@ export default {
|
|||
this.answers = [];
|
||||
this.shopIndex = 0;
|
||||
this.selectedValue = "";
|
||||
|
||||
if (this.$refs.buttonQuestion) {
|
||||
this.$refs.buttonQuestion.resetField();
|
||||
}
|
||||
},
|
||||
async reloadShopData(serviceZipCode) {
|
||||
const result = await this.loadData(serviceZipCode);
|
||||
|
|
|
|||
Loading…
Reference in a new issue