From a9d8b9e08a52401389b47cfecd4651da2778aa79 Mon Sep 17 00:00:00 2001 From: Sneha Date: Thu, 16 Nov 2023 14:08:58 +0530 Subject: [PATCH] focus on input --- src/layouts/payment-method/payment-method.vue | 1 - .../promo-modal-question/promo-modal-question.spec.js | 11 ----------- .../promo-modal-question/promo-modal-question.vue | 8 ++++++-- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index d672dbd06..ada14d27f 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -34,7 +34,6 @@ class="pb-3" v-model="lineItems" :availableVaps="availableVaps" - linkWidgetName="PromoLinkWidget" modalWidgetName="PromoModalWidget" />
diff --git a/src/layouts/payment-method/promo-modal-question/promo-modal-question.spec.js b/src/layouts/payment-method/promo-modal-question/promo-modal-question.spec.js index 3846a6bfd..94de72765 100644 --- a/src/layouts/payment-method/promo-modal-question/promo-modal-question.spec.js +++ b/src/layouts/payment-method/promo-modal-question/promo-modal-question.spec.js @@ -14,13 +14,8 @@ jest.mock("@/digital-components/modal/modal", () => ({ }, })); -const linkWidgetName = "linkWidgetName"; const modalWidgetName = "modalWidgetName"; -const mockLinkCmsContent = { - BodyText: "Sample link body text here.", -}; - const mockModalCmsContent = { FooterText: "Sample modal footer text here.", }; @@ -28,10 +23,6 @@ const mockModalCmsContent = { const mockMixin = { methods: { getCmsContent: jest.fn((widgetName, cmsFieldName) => { - if (widgetName === linkWidgetName) { - return mockLinkCmsContent[cmsFieldName]; - } - if (widgetName === modalWidgetName) { return mockModalCmsContent[cmsFieldName]; } @@ -48,7 +39,6 @@ describe("promo-modal-question.vue", () => { const wrapper = mount(promoModalQuestion, { mixins: [mockMixin], props: { - linkWidgetName: linkWidgetName, modalWidgetName: modalWidgetName, }, attachTo: document.body, @@ -74,7 +64,6 @@ describe("promo-modal-question.vue", () => { mixins: [mockMixin], props: { modelValue: lineItems, - linkWidgetName: linkWidgetName, modalWidgetName: modalWidgetName, }, attachTo: document.body, diff --git a/src/layouts/payment-method/promo-modal-question/promo-modal-question.vue b/src/layouts/payment-method/promo-modal-question/promo-modal-question.vue index deff594e5..1f9fc4a9a 100644 --- a/src/layouts/payment-method/promo-modal-question/promo-modal-question.vue +++ b/src/layouts/payment-method/promo-modal-question/promo-modal-question.vue @@ -10,12 +10,14 @@ :ref="modalName" :headerText="modalHeaderText" :onModalClosedCallback="onModalClosed" + :onModalOpenedCallback="focusOnPromoInput" :footerButtonText="modalFooterText" @footer-button-event="addPromoCode">