CASH-273
unit test cases
This commit is contained in:
parent
a2be43e190
commit
06d7edadab
1 changed files with 15 additions and 0 deletions
|
|
@ -69,6 +69,15 @@ jest.mock(
|
||||||
getShopProviderData: jest.fn((mockServiceZipCode) => {
|
getShopProviderData: jest.fn((mockServiceZipCode) => {
|
||||||
return mockGetShopProviderData(mockServiceZipCode);
|
return mockGetShopProviderData(mockServiceZipCode);
|
||||||
}),
|
}),
|
||||||
|
getZipCodeData: jest.fn().mockImplementation(() => {
|
||||||
|
return Promise.resolve({
|
||||||
|
containsMilitaryBase: false,
|
||||||
|
isServiceable: true,
|
||||||
|
isValid: true,
|
||||||
|
state: "testState",
|
||||||
|
zipCodeCtu: "testCTU",
|
||||||
|
});
|
||||||
|
}),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -424,6 +433,7 @@ describe("service-location.vue", () => {
|
||||||
},
|
},
|
||||||
selectedAppointmentType: "Mobile",
|
selectedAppointmentType: "Mobile",
|
||||||
providerData: { mobileProviderNumber: "01820" },
|
providerData: { mobileProviderNumber: "01820" },
|
||||||
|
isGlassServiceableMobile: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
const mobileLocationQuestionsComponent = wrapper.findComponent({
|
const mobileLocationQuestionsComponent = wrapper.findComponent({
|
||||||
|
|
@ -459,6 +469,7 @@ describe("service-location.vue", () => {
|
||||||
isVehicleProtected: true,
|
isVehicleProtected: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
wrapper.vm.closeModalAction = jest.fn();
|
||||||
// Act
|
// Act
|
||||||
|
|
||||||
// Trigger the event
|
// Trigger the event
|
||||||
|
|
@ -483,6 +494,7 @@ describe("service-location.vue", () => {
|
||||||
},
|
},
|
||||||
selectedAppointmentType: "Mobile",
|
selectedAppointmentType: "Mobile",
|
||||||
providerData: { mobileProviderNumber: "01820" },
|
providerData: { mobileProviderNumber: "01820" },
|
||||||
|
isGlassServiceableMobile: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
const mobileLocationQuestionsComponent = wrapper.findComponent({
|
const mobileLocationQuestionsComponent = wrapper.findComponent({
|
||||||
|
|
@ -532,6 +544,7 @@ describe("service-location.vue", () => {
|
||||||
zipCodeCtu: "01526",
|
zipCodeCtu: "01526",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
wrapper.vm.closeModalAction = jest.fn();
|
||||||
// Act
|
// Act
|
||||||
|
|
||||||
// Trigger the event
|
// Trigger the event
|
||||||
|
|
@ -563,6 +576,7 @@ describe("service-location.vue", () => {
|
||||||
});
|
});
|
||||||
mobileLocationQuestionsComponent.resetComponent = jest.fn();
|
mobileLocationQuestionsComponent.resetComponent = jest.fn();
|
||||||
wrapper.vm.forwardButtonAction = jest.fn();
|
wrapper.vm.forwardButtonAction = jest.fn();
|
||||||
|
wrapper.vm.isServiceableMobile = true;
|
||||||
|
|
||||||
const serviceZipCodeComponent = wrapper.findComponent({
|
const serviceZipCodeComponent = wrapper.findComponent({
|
||||||
ref: "serviceZipCodeQuestion",
|
ref: "serviceZipCodeQuestion",
|
||||||
|
|
@ -580,6 +594,7 @@ describe("service-location.vue", () => {
|
||||||
isVehicleProtected: "YesAnswer",
|
isVehicleProtected: "YesAnswer",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
wrapper.vm.closeModalAction = jest.fn();
|
||||||
// Act
|
// Act
|
||||||
mobileLocationQuestionsComponent.vm.$emit(
|
mobileLocationQuestionsComponent.vm.$emit(
|
||||||
"setMobileLocationAndProceed",
|
"setMobileLocationAndProceed",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue