Browse Source
test: fix Modal.confirm test coverage to 100% (#41182)
* test: fix modal test cov
* test: fix modal test cov
* test: fix test case
pull/41205/head
afc163
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
6 additions and
9 deletions
-
components/modal/ConfirmDialog.tsx
-
components/modal/Modal.tsx
-
components/modal/PurePanel.tsx
|
|
@ -106,9 +106,7 @@ export function ConfirmContent( |
|
|
|
)} |
|
|
|
<div className={`${confirmPrefixCls}-content`}>{props.content}</div> |
|
|
|
</div> |
|
|
|
{footer !== undefined ? ( |
|
|
|
footer |
|
|
|
) : ( |
|
|
|
{footer === undefined ? ( |
|
|
|
<div className={`${confirmPrefixCls}-btns`}> |
|
|
|
{cancelButton} |
|
|
|
<ActionButton |
|
|
@ -122,6 +120,8 @@ export function ConfirmContent( |
|
|
|
{okText || (mergedOkCancel ? mergedLocale?.okText : mergedLocale?.justOkText)} |
|
|
|
</ActionButton> |
|
|
|
</div> |
|
|
|
) : ( |
|
|
|
footer |
|
|
|
)} |
|
|
|
</div> |
|
|
|
); |
|
|
|
|
|
@ -182,6 +182,7 @@ const Modal: React.FC<ModalProps> = (props) => { |
|
|
|
visible, |
|
|
|
|
|
|
|
width = 520, |
|
|
|
footer, |
|
|
|
...restProps |
|
|
|
} = props; |
|
|
|
|
|
|
@ -210,11 +211,7 @@ const Modal: React.FC<ModalProps> = (props) => { |
|
|
|
rootClassName={classNames(hashId, rootClassName)} |
|
|
|
wrapClassName={wrapClassNameExtended} |
|
|
|
footer={ |
|
|
|
props.footer === null ? ( |
|
|
|
props.footer |
|
|
|
) : ( |
|
|
|
<Footer {...props} onOk={handleOk} onCancel={handleCancel} /> |
|
|
|
) |
|
|
|
footer === null ? footer : <Footer {...props} onOk={handleOk} onCancel={handleCancel} /> |
|
|
|
} |
|
|
|
visible={open ?? visible} |
|
|
|
mousePosition={restProps.mousePosition ?? mousePosition} |
|
|
|
|
|
@ -119,7 +119,7 @@ const PurePanel: React.FC<PurePanelProps> = (props) => { |
|
|
|
additionalProps = { |
|
|
|
closable: closable ?? true, |
|
|
|
title, |
|
|
|
footer: props.footer === null ? props.footer : <Footer {...props} />, |
|
|
|
footer: <Footer {...props} />, |
|
|
|
children, |
|
|
|
}; |
|
|
|
} |
|
|
|