diff --git a/components/modal/__tests__/Modal.test.tsx b/components/modal/__tests__/Modal.test.tsx index 96a2fe0039..dc6d7c852f 100644 --- a/components/modal/__tests__/Modal.test.tsx +++ b/components/modal/__tests__/Modal.test.tsx @@ -5,6 +5,7 @@ import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; import { fireEvent, render } from '../../../tests/utils'; import { resetWarned } from '../../_util/warning'; +import Form, { FormProps } from '../../form'; jest.mock('rc-util/lib/Portal'); @@ -126,4 +127,27 @@ describe('Modal', () => { render(footer} />); expect(document.querySelector('.custom-footer')).toBeTruthy(); }); + + describe('in Form', () => { + const FormDemo = (opt: { formProps?: FormProps; modalProps?: ModalProps }) => ( +
+ + + +
+ ); + + it('should not pass disabled to footer', () => { + const { getAllByRole } = render( + , + ); + + const footerBts = getAllByRole('button'); + expect(footerBts).toBeTruthy(); + + footerBts.forEach((bt) => { + expect(bt).not.toHaveAttribute('disabled'); + }); + }); + }); });