From a9e70cb1f2355eaea2a81d662328721eb62d833b Mon Sep 17 00:00:00 2001 From: Paul Tavares Date: Tue, 11 May 2021 09:52:21 -0400 Subject: [PATCH] test for list page to ensure delete modal is shown --- .../view/components/event_filter_delete_modal.tsx | 2 +- .../view/event_filters_list_page.test.tsx | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/event_filter_delete_modal.tsx b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/event_filter_delete_modal.tsx index bd540ef31fe6b..50a32ac7a75eb 100644 --- a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/event_filter_delete_modal.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/event_filter_delete_modal.tsx @@ -56,7 +56,7 @@ export const EventFilterDeleteModal = memo<{}>(() => { return ( - + { expect(renderResult.getByTestId('eventFiltersContent-error').textContent).toEqual(' oh no'); }); + + it('should show modal when delete is clicked on a card', async () => { + render(); + await dataReceived(); + act(() => { + fireEvent.click(renderResult.getByTestId('exceptionsViewerDeleteBtn')); + }); + + expect( + renderResult.baseElement.querySelector('[data-test-subj="eventFilterDeleteModalHeader"]') + ).not.toBeNull(); + }); }); });