From 10a094bee1a148e61604f27c95f865d8fa72799c Mon Sep 17 00:00:00 2001 From: Vladimir Cucu <108150922+vladimir-cucu@users.noreply.github.com> Date: Tue, 26 Mar 2024 08:11:21 +0200 Subject: [PATCH 1/9] fix: stop click event propagation in Modal (#1058) --- .../ConfirmationModal.test.tsx | 69 +++++++++++++++++++ .../ConfirmationModal/ConfirmationModal.tsx | 20 +++++- src/components/Modal/Modal.test.tsx | 32 +++++++++ src/components/Modal/Modal.tsx | 58 ++++++++++------ 4 files changed, 156 insertions(+), 23 deletions(-) diff --git a/src/components/ConfirmationModal/ConfirmationModal.test.tsx b/src/components/ConfirmationModal/ConfirmationModal.test.tsx index a984f374d..73830c53b 100644 --- a/src/components/ConfirmationModal/ConfirmationModal.test.tsx +++ b/src/components/ConfirmationModal/ConfirmationModal.test.tsx @@ -55,4 +55,73 @@ describe("ConfirmationModal ", () => { await userEvent.click(screen.getByText("Proceed")); expect(onConfirm).toHaveBeenCalled(); }); + + it("should stop click event propagation on cancel by default", async () => { + const handleExternalClick = jest.fn(); + render( +
- {messageType}: {error || caution || success} + {error || caution || success}