diff --git a/components/modal/__tests__/index.test.tsx b/components/modal/__tests__/index.test.tsx index 7e6d2c3bb..6f56ba461 100644 --- a/components/modal/__tests__/index.test.tsx +++ b/components/modal/__tests__/index.test.tsx @@ -63,7 +63,7 @@ describe('Modal', () => { expect(closeHandler).not.toHaveBeenCalled() }) - it('should ignore backdrop disabled when actions missing', async () => { + it('should disable backdrop even if actions missing', async () => { const closeHandler = jest.fn() const wrapper = mount( @@ -72,8 +72,8 @@ describe('Modal', () => { ) wrapper.find('.backdrop').simulate('click', nativeEvent) await updateWrapper(wrapper, 500) - expectModalIsClosed(wrapper) - expect(closeHandler).toHaveBeenCalled() + expectModalIsOpened(wrapper) + expect(closeHandler).not.toHaveBeenCalled() }) it('should ignore event when action disabled', () => { diff --git a/components/modal/modal.tsx b/components/modal/modal.tsx index 5f126ed0f..28aed2669 100644 --- a/components/modal/modal.tsx +++ b/components/modal/modal.tsx @@ -66,7 +66,7 @@ const Modal: React.FC> = ({ }, [open]) const closeFromBackdrop = () => { - if (disableBackdropClick && hasActions) return + if (disableBackdropClick) return closeModal() }