Skip to content

Commit

Permalink
test: add unit case
Browse files Browse the repository at this point in the history
  • Loading branch information
Wxh16144 committed Jun 27, 2023
1 parent 8b81909 commit 16e4958
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions components/form/__tests__/index.test.tsx
Expand Up @@ -1897,4 +1897,23 @@ describe('Form', () => {
'Warning: [antd: Form] There exist multiple Form with same `name`.',
);
});

// https://github.com/ant-design/ant-design/issues/43044
it('should not pass disabled to modal footer button', () => {
render(
// <FormDemo formProps={{ disabled: true }} modalProps={{ open: true }} />,
<Form disabled>
<Form.Item label="label">
<Modal open />
</Form.Item>
</Form>,
);

const footerBts = document.querySelectorAll('.ant-modal-footer > button');
expect(footerBts).toBeTruthy();

footerBts.forEach((bt) => {
expect(bt).not.toHaveAttribute('disabled');
});
});
});

0 comments on commit 16e4958

Please sign in to comment.