test: fix cov (#41214)

This commit is contained in:
MadCcc 2023-03-14 11:17:05 +08:00 committed by GitHub
parent 571224efa1
commit 989d033978
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -118,7 +118,12 @@ describe('Modal', () => {
});
it('should not render footer if null', () => {
const { container } = render(<Modal footer={null} />);
expect(container.querySelector('.ant-modal-footer')).toBeFalsy();
render(<Modal open footer={null} />);
expect(document.querySelector('.ant-modal-footer')).toBeFalsy();
});
it('should render custom footer', () => {
render(<Modal open footer={<div className="custom-footer">footer</div>} />);
expect(document.querySelector('.custom-footer')).toBeTruthy();
});
});