Skip to content

Commit

Permalink
test for list page to ensure delete modal is shown
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-tavares committed May 11, 2021
1 parent b52ba9a commit a9e70cb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const EventFilterDeleteModal = memo<{}>(() => {

return (
<EuiModal onClose={onCancel}>
<EuiModalHeader>
<EuiModalHeader data-test-subj="eventFilterDeleteModalHeader">
<EuiModalHeaderTitle>
<FormattedMessage
id="xpack.securitySolution.eventFilters.deletionDialog.title"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,17 @@ describe('When on the Event Filters List Page', () => {

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();
});
});
});

0 comments on commit a9e70cb

Please sign in to comment.