From e55086533333a965eed1f5cad5dd5422ff5c8b54 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Tue, 5 Sep 2023 07:20:02 -0400 Subject: [PATCH] Updated unit tests - remove console.logs --- src/layouts/schedule/schedule.spec.js | 2 +- .../time-slot-modal-question.spec.js | 47 +++++++++---------- .../time-slot-modal-question.vue | 2 - 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/layouts/schedule/schedule.spec.js b/src/layouts/schedule/schedule.spec.js index 54b86af90..e8447f3ab 100644 --- a/src/layouts/schedule/schedule.spec.js +++ b/src/layouts/schedule/schedule.spec.js @@ -404,7 +404,7 @@ describe("schedule.vue...", () => { routeCode: null, }, isPremiumAppointment: null, - } + }; wrapper.setData({ selectedTimeSlotInfo: selectedTimeSlotInfo, diff --git a/src/layouts/schedule/time-slot-modal-question/time-slot-modal-question.spec.js b/src/layouts/schedule/time-slot-modal-question/time-slot-modal-question.spec.js index 775bf3a39..cbfe355e3 100644 --- a/src/layouts/schedule/time-slot-modal-question/time-slot-modal-question.spec.js +++ b/src/layouts/schedule/time-slot-modal-question/time-slot-modal-question.spec.js @@ -89,8 +89,8 @@ describe("time-slot-modal-question.vue", () => { wrapper.vm.$refs.timeSlots.closeModal = jest.fn(); await wrapper.setData({ - selectedRouteCode: routeCode - }) + selectedRouteCode: routeCode, + }); //Act wrapper.vm.setSelectedTimeSlot(); @@ -176,7 +176,7 @@ describe("time-slot-modal-question.vue Supplemental information", () => { const dropOffWidgetName = "Dropoff"; const modelValue = { timeSlot: { - routeCode: `test${ RouteCodeFlags.ALL_DAY_DROP_OFF }`, + routeCode: `test${RouteCodeFlags.ALL_DAY_DROP_OFF}`, date: null, startTime: null, endTime: null, @@ -184,7 +184,7 @@ describe("time-slot-modal-question.vue Supplemental information", () => { jobMinMinutes: null, }, isPremiumAppointment: null, - } + }; const { wrapper } = setupMocks({ customMountOptions: { @@ -196,9 +196,6 @@ describe("time-slot-modal-question.vue Supplemental information", () => { }, }); - - console.log(wrapper.vm.selectedRouteCode) - //Assert expect(wrapper.vm.supplementalInformationBlock).toEqual( mockCmsContent[dropOffWidgetName]["BodyText"] @@ -210,7 +207,7 @@ describe("time-slot-modal-question.vue Supplemental information", () => { const overnightDropOffCmsWidgetName = "Overnight"; const modelValue = { timeSlot: { - routeCode: `test${ RouteCodeFlags.OVERNIGHT_DROP_OFF }`, + routeCode: `test${RouteCodeFlags.OVERNIGHT_DROP_OFF}`, date: null, startTime: null, endTime: null, @@ -218,7 +215,7 @@ describe("time-slot-modal-question.vue Supplemental information", () => { jobMinMinutes: null, }, isPremiumAppointment: null, - } + }; const { wrapper } = setupMocks({ customMountOptions: { @@ -247,7 +244,7 @@ describe("time-slot-modal-question.vue Supplemental information", () => { const jobMinMinutes = 50; const modelValue = { timeSlot: { - routeCode: `test${ RouteCodeFlags.ALL_DAY_DROP_OFF }`, + routeCode: `test${RouteCodeFlags.ALL_DAY_DROP_OFF}`, date: null, startTime: null, endTime: null, @@ -255,7 +252,7 @@ describe("time-slot-modal-question.vue Supplemental information", () => { jobMinMinutes: null, }, isPremiumAppointment: null, - } + }; const { wrapper } = setupMocks({ customMountOptions: { @@ -299,7 +296,7 @@ describe("time-slot-modal-list-button-question.vue Disclaimer", () => { const modelValue = { timeSlot: { - routeCode: `Test${ RouteCodeFlags.ALL_DAY_DROP_OFF }`, + routeCode: `Test${RouteCodeFlags.ALL_DAY_DROP_OFF}`, date: null, startTime: null, endTime: null, @@ -307,8 +304,8 @@ describe("time-slot-modal-list-button-question.vue Disclaimer", () => { jobMinMinutes: null, }, isPremiumAppointment: null, - } - + }; + const { wrapper } = setupMocks({ customMountOptions: { propsData: { @@ -336,13 +333,13 @@ describe("time-slot-modal-list-button-question.vue Disclaimer", () => { mockCmsContent[sameDayDropOffCmsWidgetName]["FooterText"] ); }); - + test("Correct disclaimer information should be retrieved, Dropoff regular", async () => { //Arrange const dropOffWidgetName = "Dropoff"; const modelValue = { timeSlot: { - routeCode: `Test${ RouteCodeFlags.ALL_DAY_DROP_OFF }`, + routeCode: `Test${RouteCodeFlags.ALL_DAY_DROP_OFF}`, date: null, startTime: null, endTime: null, @@ -350,7 +347,7 @@ describe("time-slot-modal-list-button-question.vue Disclaimer", () => { jobMinMinutes: null, }, isPremiumAppointment: null, - } + }; const { wrapper } = setupMocks({ customMountOptions: { @@ -367,13 +364,13 @@ describe("time-slot-modal-list-button-question.vue Disclaimer", () => { mockCmsContent[dropOffWidgetName]["FooterText"] ); }); - + test("Correct disclaimer information should be retrieved, Dropoff overnight", async () => { //Arrange const overnightDropOffCmsWidgetName = "Overnight"; const modelValue = { timeSlot: { - routeCode: `Test${ RouteCodeFlags.OVERNIGHT_DROP_OFF }`, + routeCode: `Test${RouteCodeFlags.OVERNIGHT_DROP_OFF}`, date: null, startTime: null, endTime: null, @@ -381,7 +378,7 @@ describe("time-slot-modal-list-button-question.vue Disclaimer", () => { jobMinMinutes: null, }, isPremiumAppointment: null, - } + }; const { wrapper } = setupMocks({ customMountOptions: { @@ -412,7 +409,7 @@ describe("time-slot-modal-list-button-question.vue Disclaimer", () => { jobMinMinutes: null, }, isPremiumAppointment: null, - } + }; const { wrapper } = setupMocks({ customMountOptions: { @@ -449,7 +446,7 @@ describe("time-slot-modal-question.vue Duration", () => { jobMinMinutes: null, }, isPremiumAppointment: null, - } + }; const { wrapper } = setupMocks({ customMountOptions: { @@ -493,7 +490,7 @@ describe("time-slot-modal-question.vue Duration", () => { jobMinMinutes: null, }, isPremiumAppointment: null, - } + }; const { wrapper } = setupMocks({ customMountOptions: { @@ -525,7 +522,7 @@ describe("time-slot-modal-question.vue Duration", () => { jobMinMinutes: null, }, isPremiumAppointment: null, - } + }; const { wrapper } = setupMocks({ customMountOptions: { @@ -554,7 +551,7 @@ describe("time-slot-modal-question.vue Duration", () => { endTime: null, }, isPremiumAppointment: null, - } + }; const { wrapper } = setupMocks({ customMountOptions: { diff --git a/src/layouts/schedule/time-slot-modal-question/time-slot-modal-question.vue b/src/layouts/schedule/time-slot-modal-question/time-slot-modal-question.vue index 7d4891594..b6cc95365 100644 --- a/src/layouts/schedule/time-slot-modal-question/time-slot-modal-question.vue +++ b/src/layouts/schedule/time-slot-modal-question/time-slot-modal-question.vue @@ -157,12 +157,10 @@ export default { return this.$refs[this.modalName]; }, supplementalInformationBlock() { - console.log(this.selectedRouteCode) let appointmentTypeCmsWidgetName; if (this.appointmentType === AppointmentTypeStrings.IN_SHOP) { return null; } else if (this.appointmentType === AppointmentTypeStrings.MOBILE) { - appointmentTypeCmsWidgetName = this.selectedRouteCode?.includes( PREMIUM_TIME_SLOT_ID_FLAG )