mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 02:59:04 +08:00
test: fix Modal.confirm test coverage to 100% (#41182)
* test: fix modal test cov * test: fix modal test cov * test: fix test case
This commit is contained in:
parent
a6b07948a7
commit
c0d275b4ff
@ -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,
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user