From d6f7e60b07e9994326f1255a6a11a0e4d4dba9b1 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Mon, 29 Aug 2022 18:05:47 -0400 Subject: [PATCH 1/3] CSR-110: add additional check to avoid console error in question-chain --- src/layouts/molding-questions/molding-questions.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layouts/molding-questions/molding-questions.vue b/src/layouts/molding-questions/molding-questions.vue index ed7e54307..19d468411 100644 --- a/src/layouts/molding-questions/molding-questions.vue +++ b/src/layouts/molding-questions/molding-questions.vue @@ -118,7 +118,7 @@ export default { return moldingQuestionsFromPageData && Object.keys(moldingQuestionsFromPageData).length > 0; }, showThisQuestionChain(glass, i) { - if (glass.questions?.length < 1 || glass.isSuppressedPart) { return false; } // return false if no questions or if suppressed + if (!glass.questions || glass.questions?.length < 1 || glass.isSuppressedPart) { return false; } // return false if no questions or if suppressed return this.currentGlassIndex === i || glass.answerData?.answerResult?.length > 0; }, async forwardButtonAction() { From 28b6524ac56e7466032165e9d96a899ce758c8db Mon Sep 17 00:00:00 2001 From: Katie Date: Tue, 30 Aug 2022 14:14:25 -0400 Subject: [PATCH 2/3] CSR-807 Edit arePagePrerequisitesValid for estimate --- src/layouts/estimate/estimate.vue | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index 26649942a..aae192291 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -80,10 +80,7 @@ export default { }, methods: { arePagePrerequisitesValid() { - if(store.getters.damage.isRepair != null){ - return true; - } - return false; + return store.getters.damage.isRepair || store.getters.damage.glassToReplace?.length > 0; }, backButtonAction() { // route to move backwards From edb0f8af6668885467f0f4977f2f012b9a3c67c5 Mon Sep 17 00:00:00 2001 From: Katie Date: Tue, 30 Aug 2022 14:30:51 -0400 Subject: [PATCH 3/3] CSR-807 Add test todos for estimate --- src/layouts/estimate/estimate.spec.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/layouts/estimate/estimate.spec.js b/src/layouts/estimate/estimate.spec.js index 2b52d3f3e..a24bc22b7 100644 --- a/src/layouts/estimate/estimate.spec.js +++ b/src/layouts/estimate/estimate.spec.js @@ -49,19 +49,22 @@ describe("estimate.vue", () => { //Assert expect(arePagePrerequisitesValid).toBe(true); }); - test("isRepair is set to false, arePagePrerequisitesValid should return true", async () => { + test("isRepair is set to true, arePagePrerequisitesValid should return true", async () => { //Arrange const { wrapper } = setupMocks({}); //Act - store.commit( storeMutations.UPDATE_IS_REPAIR, false ); + store.commit( storeMutations.UPDATE_IS_REPAIR, true ); let arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid(); //Assert expect(arePagePrerequisitesValid).toBe(true); }); + test.todo("isRepair is false and there are no lineItems => should return false") + test.todo("isRepair is false and lineItems is null => should return false") + test.todo("isRepair is false are there are lineItems => should return true") test("isRepair is set to null, arePagePrerequisitesValid should return false", async () => { //Arrange