diff --git a/src/layouts/service-location/service-location.spec.js b/src/layouts/service-location/service-location.spec.js index a7093cef0..1e19c00f7 100644 --- a/src/layouts/service-location/service-location.spec.js +++ b/src/layouts/service-location/service-location.spec.js @@ -22,28 +22,6 @@ jest.mock("@/helpers/cms-content-helper", () => ({ jest.mock("@/store", () => ({ commit: jest.fn(), dispatch: jest.fn(), - getters: { - lineItems: { - supportingItems: [ - { - description: null, - kitPrice: 0, - laborAmount: 0, - partNumber: "SUPPLIES-REPAIR", - partType: "REPAIR FEE", - sellingPrice: 7.99, - }, - ], - }, - order: { - serviceLocation: { - zipCode: "43235", - }, - }, - payment: { - isInsurance: false, - }, - }, })); beforeEach(() => { @@ -63,11 +41,21 @@ beforeEach(() => { order: { serviceLocation: { zipCode: "43235", + state: "OH", + isServiceable: true, }, }, payment: { isInsurance: false, }, + vehicle: { + registration: { + address: undefined, + city: undefined, + state: undefined, + zipCode: undefined, + }, + }, }; }); diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index f6aeb833e..066405e82 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -93,25 +93,25 @@ export default { ); }, getRegistrationAddressFromStore() { - return this.$store.getters.vehicle.registration.address; + return store.getters.vehicle.registration.address; }, getRegistrationCityFromStore() { - return this.$store.getters.vehicle.registration.city; + return store.getters.vehicle.registration.city; }, getRegistrationStateFromStore() { - return this.$store.getters.vehicle.registration.state; + return store.getters.vehicle.registration.state; }, getRegistrationZipFromStore() { - return this.$store.getters.vehicle.registration.zipCode; + return store.getters.vehicle.registration.zipCode; }, getServiceZipCodeFromStore() { - return this.$store.getters.order.serviceLocation.zipCode; + return store.getters.order.serviceLocation.zipCode; }, getServiceStateFromStore() { - return this.$store.getters.order.serviceLocation.state; + return store.getters.order.serviceLocation.state; }, getIsServiceableFromStore() { - return this.$store.getters.order.serviceLocation.isServiceable; + return store.getters.order.serviceLocation.isServiceable; }, resetMobileLocation(updatedServiceZipCode) { this.mobileLocationQuestions = { diff --git a/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.spec.js b/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.spec.js index 3c2384944..a98b4f89d 100644 --- a/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.spec.js +++ b/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.spec.js @@ -175,62 +175,6 @@ describe("service-zip-modal-question.vue", () => { expect(wrapper.emitted("update:modelValue")).not.toBeTruthy(); }); - it("Should emit service-zip-updated on setZipCode for a valid, serviceable zip", async () => { - // Arrange - let serviceZipCodeQuestion = { - state: "IL", - zipCode: "61606", - isServiceable: true, - }; - - const zip = "43235"; - - const wrapper = mount(serviceZipModalQuestion, { - mixins: [mockMixin], - props: { - modelValue: serviceZipCodeQuestion, - linkWidgetName: linkWidgetName, - modalWidgetName: modalWidgetName, - }, - attachTo: document.body, - }); - - // Act - wrapper.vm.internalModel.zipCode = zip; - await wrapper.vm.setZipCode(); - - // Assert - expect(wrapper.emitted("service-zip-updated")).toBeTruthy(); - }); - - it("Should not emit service-zip-updated on setZipCode for an invalid zip", async () => { - // Arrange - let serviceZipCodeQuestion = { - state: "IL", - zipCode: "61606", - isServiceable: true, - }; - - const zip = ""; - - const wrapper = mount(serviceZipModalQuestion, { - mixins: [mockMixin], - props: { - modelValue: serviceZipCodeQuestion, - linkWidgetName: linkWidgetName, - modalWidgetName: modalWidgetName, - }, - attachTo: document.body, - }); - - // Act - wrapper.vm.internalModel.zipCode = zip; - await wrapper.vm.setZipCode(); - - // Assert - expect(wrapper.emitted("service-zip-updated")).not.toBeTruthy(); - }); - it("Should display invalid zip alerts for invalid ip inputs", async () => { // Arrange let serviceZipCodeQuestion = {