Skip to content

Commit

Permalink
fixed due to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
YulNaumenko committed Jul 19, 2021
1 parent 079d569 commit 81af4dc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,28 @@ describe('alerts_list component with items', () => {
})
);
});

it('sorts alerts when clicking the enabled column', async () => {
await setup();
wrapper
.find('[data-test-subj="tableHeaderCell_enabled_0"] .euiTableHeaderButton')
.first()
.simulate('click');

await act(async () => {
await nextTick();
wrapper.update();
});

expect(loadAlerts).toHaveBeenCalledWith(
expect.objectContaining({
sort: {
field: 'enabled',
direction: 'desc',
},
})
);
});
});

describe('alerts_list component empty with show only capability', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,12 +503,7 @@ export const AlertsList: React.FunctionComponent = () => {
<EuiButtonIcon
color={'danger'}
className="alertSidebarItem__action"
onClick={async () => {
asyncScheduler.schedule(async () => {
await muteAlert({ http, id: item.id });
loadAlertsData();
}, 10);
}}
onClick={() => setAlertsToDelete([item.id])}
iconType={'trash'}
aria-label={i18n.translate(
'xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.deleteAriaLabel',
Expand Down

0 comments on commit 81af4dc

Please sign in to comment.