diff --git a/src/digital-components/modal/modal.spec.js b/src/digital-components/modal/modal.spec.js index 4c130e08..fd05174d 100644 --- a/src/digital-components/modal/modal.spec.js +++ b/src/digital-components/modal/modal.spec.js @@ -81,7 +81,6 @@ describe('modal.vue', () => { validate: mockValidate(true) }); - const resetButtonStyle = jest.fn(); const wrapper = shallowMount(modal, { props: { footerButtonText, @@ -89,7 +88,6 @@ describe('modal.vue', () => { }, attachTo: document.body }); - wrapper.vm.resetButtonStyle = resetButtonStyle; // Act const buttonMain = wrapper.findComponent({ ref: 'modalButtonMain' }); @@ -112,8 +110,6 @@ describe('modal.vue', () => { meta: mockMeta(fakeMeta), validate: mockValidate(false) }); - - const resetButtonStyle = jest.fn(); const wrapper = shallowMount(modal, { props: { footerButtonText, @@ -121,7 +117,6 @@ describe('modal.vue', () => { }, attachTo: document.body }); - wrapper.vm.resetButtonStyle = resetButtonStyle; // Act const buttonMain = wrapper.findComponent({ ref: 'modalButtonMain' }); @@ -144,8 +139,6 @@ describe('modal.vue', () => { meta: mockMeta(fakeMeta), validate: mockValidate(true) }); - - const resetButtonStyle = jest.fn(); const wrapper = shallowMount(modal, { props: { footerButtonText, @@ -153,7 +146,6 @@ describe('modal.vue', () => { }, attachTo: document.body }); - wrapper.vm.resetButtonStyle = resetButtonStyle; // Assert expect(wrapper.vm.isFooterButtonDisabled).toBe(true); @@ -172,8 +164,6 @@ describe('modal.vue', () => { meta: mockMeta(fakeMeta), validate: mockValidate(true) }); - - const resetButtonStyle = jest.fn(); const wrapper = shallowMount(modal, { props: { footerButtonText, @@ -181,7 +171,6 @@ describe('modal.vue', () => { }, attachTo: document.body }); - wrapper.vm.resetButtonStyle = resetButtonStyle; // Assert expect(wrapper.vm.isFooterButtonDisabled).toBe(true); @@ -202,8 +191,6 @@ describe('modal.vue', () => { }); const showMock = jest.spyOn(Modal.prototype, 'show'); - - const resetButtonStyle = jest.fn(); const wrapper = shallowMount(modal, { props: { footerButtonText, @@ -211,7 +198,6 @@ describe('modal.vue', () => { }, attachTo: document.body }); - wrapper.vm.resetButtonStyle = resetButtonStyle; // Act wrapper.vm.openModal(); @@ -234,8 +220,6 @@ describe('modal.vue', () => { validate: mockValidate(true) }); const hideMock = jest.spyOn(Modal.prototype, 'hide'); - - const resetButtonStyle = jest.fn(); const wrapper = shallowMount(modal, { props: { footerButtonText, @@ -243,7 +227,6 @@ describe('modal.vue', () => { }, attachTo: document.body }); - wrapper.vm.resetButtonStyle = resetButtonStyle; // Act wrapper.vm.openModal(); diff --git a/src/digital-components/modal/modal.vue b/src/digital-components/modal/modal.vue index 0ab74b24..97f18ee6 100644 --- a/src/digital-components/modal/modal.vue +++ b/src/digital-components/modal/modal.vue @@ -115,8 +115,6 @@ export default { const validationResult = await this.validate(); if (validationResult.valid) { this.$emit('footer-button-event'); - } else { - this.resetButtonStyle(); } }, async onKeyDown(e) { @@ -125,14 +123,10 @@ export default { this.$refs.modalButtonMain.clicked(); document.getElementById(this.modalId)?.focus(); }, - resetButtonStyle() { - this.$refs.modalButtonMain?.resetButtonStyle(); - }, onModalOpened() { this.onModalOpenedCallback?.(); }, onModalClosed() { - this.resetButtonStyle(); this.onModalClosedCallback?.(); }, openModal() { diff --git a/src/iss-components/button-question-modal/button-question-modal.vue b/src/iss-components/button-question-modal/button-question-modal.vue index 76260a7f..14070bc9 100644 --- a/src/iss-components/button-question-modal/button-question-modal.vue +++ b/src/iss-components/button-question-modal/button-question-modal.vue @@ -5,8 +5,7 @@ class="modal fade modal-component" tabindex="-1" aria-labelledby="ModalComponentLabel" - aria-hidden="true" - v-on="{ 'hidden.bs.modal': resetButtonStyle }"> + aria-hidden="true">