unit test cases
This commit is contained in:
hiteshkumar87 2025-02-21 23:30:43 +05:30
parent a2be43e190
commit 06d7edadab

View file

@ -69,6 +69,15 @@ jest.mock(
getShopProviderData: jest.fn((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",
providerData: { mobileProviderNumber: "01820" },
isGlassServiceableMobile: true,
});
const mobileLocationQuestionsComponent = wrapper.findComponent({
@ -459,6 +469,7 @@ describe("service-location.vue", () => {
isVehicleProtected: true,
};
wrapper.vm.closeModalAction = jest.fn();
// Act
// Trigger the event
@ -483,6 +494,7 @@ describe("service-location.vue", () => {
},
selectedAppointmentType: "Mobile",
providerData: { mobileProviderNumber: "01820" },
isGlassServiceableMobile: true,
});
const mobileLocationQuestionsComponent = wrapper.findComponent({
@ -532,6 +544,7 @@ describe("service-location.vue", () => {
zipCodeCtu: "01526",
};
wrapper.vm.closeModalAction = jest.fn();
// Act
// Trigger the event
@ -563,6 +576,7 @@ describe("service-location.vue", () => {
});
mobileLocationQuestionsComponent.resetComponent = jest.fn();
wrapper.vm.forwardButtonAction = jest.fn();
wrapper.vm.isServiceableMobile = true;
const serviceZipCodeComponent = wrapper.findComponent({
ref: "serviceZipCodeQuestion",
@ -580,6 +594,7 @@ describe("service-location.vue", () => {
isVehicleProtected: "YesAnswer",
};
wrapper.vm.closeModalAction = jest.fn();
// Act
mobileLocationQuestionsComponent.vm.$emit(
"setMobileLocationAndProceed",