Heritage Buttons Removed resetButtonStyle method calls as this method was removed before our recent button work

This commit is contained in:
Josh Dassinger 2026-01-05 12:09:55 -06:00
parent 45e31efca5
commit c7bff1c758
7 changed files with 2 additions and 39 deletions

View file

@ -81,7 +81,6 @@ describe('modal.vue', () => {
validate: mockValidate(true) validate: mockValidate(true)
}); });
const resetButtonStyle = jest.fn();
const wrapper = shallowMount(modal, { const wrapper = shallowMount(modal, {
props: { props: {
footerButtonText, footerButtonText,
@ -89,7 +88,6 @@ describe('modal.vue', () => {
}, },
attachTo: document.body attachTo: document.body
}); });
wrapper.vm.resetButtonStyle = resetButtonStyle;
// Act // Act
const buttonMain = wrapper.findComponent({ ref: 'modalButtonMain' }); const buttonMain = wrapper.findComponent({ ref: 'modalButtonMain' });
@ -112,8 +110,6 @@ describe('modal.vue', () => {
meta: mockMeta(fakeMeta), meta: mockMeta(fakeMeta),
validate: mockValidate(false) validate: mockValidate(false)
}); });
const resetButtonStyle = jest.fn();
const wrapper = shallowMount(modal, { const wrapper = shallowMount(modal, {
props: { props: {
footerButtonText, footerButtonText,
@ -121,7 +117,6 @@ describe('modal.vue', () => {
}, },
attachTo: document.body attachTo: document.body
}); });
wrapper.vm.resetButtonStyle = resetButtonStyle;
// Act // Act
const buttonMain = wrapper.findComponent({ ref: 'modalButtonMain' }); const buttonMain = wrapper.findComponent({ ref: 'modalButtonMain' });
@ -144,8 +139,6 @@ describe('modal.vue', () => {
meta: mockMeta(fakeMeta), meta: mockMeta(fakeMeta),
validate: mockValidate(true) validate: mockValidate(true)
}); });
const resetButtonStyle = jest.fn();
const wrapper = shallowMount(modal, { const wrapper = shallowMount(modal, {
props: { props: {
footerButtonText, footerButtonText,
@ -153,7 +146,6 @@ describe('modal.vue', () => {
}, },
attachTo: document.body attachTo: document.body
}); });
wrapper.vm.resetButtonStyle = resetButtonStyle;
// Assert // Assert
expect(wrapper.vm.isFooterButtonDisabled).toBe(true); expect(wrapper.vm.isFooterButtonDisabled).toBe(true);
@ -172,8 +164,6 @@ describe('modal.vue', () => {
meta: mockMeta(fakeMeta), meta: mockMeta(fakeMeta),
validate: mockValidate(true) validate: mockValidate(true)
}); });
const resetButtonStyle = jest.fn();
const wrapper = shallowMount(modal, { const wrapper = shallowMount(modal, {
props: { props: {
footerButtonText, footerButtonText,
@ -181,7 +171,6 @@ describe('modal.vue', () => {
}, },
attachTo: document.body attachTo: document.body
}); });
wrapper.vm.resetButtonStyle = resetButtonStyle;
// Assert // Assert
expect(wrapper.vm.isFooterButtonDisabled).toBe(true); expect(wrapper.vm.isFooterButtonDisabled).toBe(true);
@ -202,8 +191,6 @@ describe('modal.vue', () => {
}); });
const showMock = jest.spyOn(Modal.prototype, 'show'); const showMock = jest.spyOn(Modal.prototype, 'show');
const resetButtonStyle = jest.fn();
const wrapper = shallowMount(modal, { const wrapper = shallowMount(modal, {
props: { props: {
footerButtonText, footerButtonText,
@ -211,7 +198,6 @@ describe('modal.vue', () => {
}, },
attachTo: document.body attachTo: document.body
}); });
wrapper.vm.resetButtonStyle = resetButtonStyle;
// Act // Act
wrapper.vm.openModal(); wrapper.vm.openModal();
@ -234,8 +220,6 @@ describe('modal.vue', () => {
validate: mockValidate(true) validate: mockValidate(true)
}); });
const hideMock = jest.spyOn(Modal.prototype, 'hide'); const hideMock = jest.spyOn(Modal.prototype, 'hide');
const resetButtonStyle = jest.fn();
const wrapper = shallowMount(modal, { const wrapper = shallowMount(modal, {
props: { props: {
footerButtonText, footerButtonText,
@ -243,7 +227,6 @@ describe('modal.vue', () => {
}, },
attachTo: document.body attachTo: document.body
}); });
wrapper.vm.resetButtonStyle = resetButtonStyle;
// Act // Act
wrapper.vm.openModal(); wrapper.vm.openModal();

View file

@ -115,8 +115,6 @@ export default {
const validationResult = await this.validate(); const validationResult = await this.validate();
if (validationResult.valid) { if (validationResult.valid) {
this.$emit('footer-button-event'); this.$emit('footer-button-event');
} else {
this.resetButtonStyle();
} }
}, },
async onKeyDown(e) { async onKeyDown(e) {
@ -125,14 +123,10 @@ export default {
this.$refs.modalButtonMain.clicked(); this.$refs.modalButtonMain.clicked();
document.getElementById(this.modalId)?.focus(); document.getElementById(this.modalId)?.focus();
}, },
resetButtonStyle() {
this.$refs.modalButtonMain?.resetButtonStyle();
},
onModalOpened() { onModalOpened() {
this.onModalOpenedCallback?.(); this.onModalOpenedCallback?.();
}, },
onModalClosed() { onModalClosed() {
this.resetButtonStyle();
this.onModalClosedCallback?.(); this.onModalClosedCallback?.();
}, },
openModal() { openModal() {

View file

@ -5,8 +5,7 @@
class="modal fade modal-component" class="modal fade modal-component"
tabindex="-1" tabindex="-1"
aria-labelledby="ModalComponentLabel" aria-labelledby="ModalComponentLabel"
aria-hidden="true" aria-hidden="true">
v-on="{ 'hidden.bs.modal': resetButtonStyle }">
<div class="modal-dialog modal-dialog-centered"> <div class="modal-dialog modal-dialog-centered">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
@ -69,9 +68,6 @@ export default {
} }
}, },
methods: { methods: {
resetButtonStyle() {
this.$refs.buttonMain.resetButtonStyle();
}
} }
}; };
</script> </script>

View file

@ -101,7 +101,6 @@ export default {
this.$refs[this.ModalName]?.closeModal(); this.$refs[this.ModalName]?.closeModal();
this.$emit('buttonClick'); this.$emit('buttonClick');
} else { } else {
this.$refs[this.ModalName]?.resetButtonStyle();
this.showError = true; this.showError = true;
} }
} }

View file

@ -260,9 +260,6 @@ export default {
this.displayInvalidZipAlert = false; this.displayInvalidZipAlert = false;
this.internalModel = deepClone(this.modelValue); this.internalModel = deepClone(this.modelValue);
}, },
resetModalButtonStyle() {
this.modal.resetButtonStyle();
},
async setMobileLocation() { async setMobileLocation() {
if ( if (
this.internalModel.addressQuestions.zipCode this.internalModel.addressQuestions.zipCode
@ -273,7 +270,6 @@ export default {
if (!zipCodeData.isValid) { if (!zipCodeData.isValid) {
this.displayInvalidZipAlert = true; this.displayInvalidZipAlert = true;
this.resetModalButtonStyle();
} else { } else {
// retrieve mobile fee part // retrieve mobile fee part
const serviceZipCode = this.internalModel.addressQuestions.zipCode; const serviceZipCode = this.internalModel.addressQuestions.zipCode;

View file

@ -10,8 +10,7 @@ jest.mock('@/digital-components/textbox-question/textbox-question', () => ({
jest.mock('@/digital-components/modal/modal', () => ({ jest.mock('@/digital-components/modal/modal', () => ({
methods: { methods: {
closeModal: jest.fn(), closeModal: jest.fn()
resetButtonStyle: jest.fn()
} }
})); }));

View file

@ -127,9 +127,6 @@ export default {
closeModal() { closeModal() {
this.$refs[this.modalName].closeModal(); this.$refs[this.modalName].closeModal();
}, },
resetModalButtonStyle() {
this.$refs[this.modalName].resetButtonStyle();
},
onInputIdAssigned(inputId) { onInputIdAssigned(inputId) {
this.serviceZipCodeTextInputId = inputId; this.serviceZipCodeTextInputId = inputId;
}, },
@ -150,7 +147,6 @@ export default {
if (!zipCodeData.isValid) { if (!zipCodeData.isValid) {
this.displayInvalidZipAlert = true; this.displayInvalidZipAlert = true;
this.focusOnZipInput(); this.focusOnZipInput();
this.resetModalButtonStyle();
} else { } else {
this.internalModel.state = zipCodeData.state; this.internalModel.state = zipCodeData.state;
const serviceZipCode = this.internalModel.zipCode; const serviceZipCode = this.internalModel.zipCode;