From 99166d28838ef93fdf4d9d30f47949aab49e3c29 Mon Sep 17 00:00:00 2001 From: Katie Date: Tue, 8 Nov 2022 13:33:26 -0500 Subject: [PATCH] CSR-748 Handle going into concept quote page --- src/layouts/estimate/estimate.spec.js | 79 +++++++++++-------- src/layouts/estimate/estimate.vue | 11 +-- .../vehicle-parts/vehicle-parts.spec.js | 6 +- src/mixins/vehicle-questions-mixin.js | 2 +- src/mixins/vehicle-questions-mixin.spec.js | 16 +++- .../router-constants/navigation-scenarios.js | 1 + src/router/router-constants/routing-table.js | 20 +++++ 7 files changed, 91 insertions(+), 44 deletions(-) diff --git a/src/layouts/estimate/estimate.spec.js b/src/layouts/estimate/estimate.spec.js index 3a5cee1ed..87c911232 100644 --- a/src/layouts/estimate/estimate.spec.js +++ b/src/layouts/estimate/estimate.spec.js @@ -39,32 +39,59 @@ describe("estimate.vue", () => { ]); }); - test("After selecting provide my home address on ForwardButtonAction triggers a router.navigateWithSaving", async () => { - //Arrange - const { wrapper } = setupMocks({}); - await wrapper.setData({ - selectedVinLookupMethod: vinLookupMethodSelections.HOMEADDRESS, + describe("move forward", () => { + test("After selecting provide my home address on ForwardButtonAction triggers a router.navigateWithSaving", async () => { + //Arrange + const { wrapper } = setupMocks({}); + await wrapper.setData({ + selectedVinLookupMethod: vinLookupMethodSelections.HOMEADDRESS, + }); + + //Act + wrapper.vm.forwardButtonAction(); + + //Assert + expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalled(); }); - //Act - wrapper.vm.forwardButtonAction(); + test("After selecting provide my manual vin on ForwardButtonAction triggers a router.navigateWithSaving", async () => { + //Arrange + const { wrapper } = setupMocks({}); + await wrapper.setData({ + selectedVinLookupMethod: vinLookupMethodSelections.MANUALVIN, + }); - //Assert - expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalled(); - }); + //Act + await wrapper.vm.forwardButtonAction(); - test("After selecting provide my manual vin on ForwardButtonAction triggers a router.navigateWithSaving", async () => { - //Arrange - const { wrapper } = setupMocks({}); - await wrapper.setData({ - selectedVinLookupMethod: vinLookupMethodSelections.MANUALVIN, + //Assert + expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalled(); }); - //Act - await wrapper.vm.forwardButtonAction(); + test("Provide my license plate on ForwardButtonAction triggers a router.navigateWithSaving", async () => { + //Arrange + const { wrapper } = setupMocks({}); + await wrapper.setData({ + selectedVinLookupMethod: vinLookupMethodSelections.LICENSEPLATE, + }); - //Assert - expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalled(); + //Act + wrapper.vm.forwardButtonAction(); + + //Assert + expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalled(); + }); + + // TODO KO + describe("isRepair", () => { + test.todo("is repair and zip codes are valid/serviceable => go to quote page"); + test.todo( + "is repair and zip codes are valid but not serviceable => show correct alert, remove loader" + ); + test.todo( + "is repair and zip codes are not valid/serviceable => show correct alert, remove loader" + ); + }); }); test("BackButtonAction triggers a router.navigateWithoutSaving change", async () => { @@ -85,20 +112,6 @@ describe("estimate.vue", () => { expect(wrapper.vm.$router.navigateWithoutSaving).toHaveBeenCalled(); }); - test("Provide my license plate on ForwardButtonAction triggers a router.navigateWithSaving", async () => { - //Arrange - const { wrapper } = setupMocks({}); - await wrapper.setData({ - selectedVinLookupMethod: vinLookupMethodSelections.LICENSEPLATE, - }); - - //Act - wrapper.vm.forwardButtonAction(); - - //Assert - expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalled(); - }); - describe("arePagePrerequisitesValid", () => { beforeEach(() => { store.commit(storeMutations.UPDATE_IS_REPAIR, false); diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index d8cfb4d47..3e84b7678 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -1,7 +1,6 @@