Skip to content

Commit

Permalink
Replace alert Table with triggers action
Browse files Browse the repository at this point in the history
  • Loading branch information
logeekal committed Jan 23, 2023
1 parent 4efc4fd commit cc9b213
Show file tree
Hide file tree
Showing 9 changed files with 213 additions and 249 deletions.
2 changes: 2 additions & 0 deletions x-pack/plugins/security_solution/cypress/screens/timeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ export const QUERY_TAB_BUTTON = '[data-test-subj="timelineTabs-query"]';

export const SERVER_SIDE_EVENT_COUNT = '[data-test-subj="server-side-event-count"]';

export const ALERTS_TABLE_COUNT = `[data-test-subj="toolbar-alerts-count"]`;

export const SOURCE_IP_KPI = '[data-test-subj="siem-timeline-source-ip-kpi"]';

export const STAR_ICON = '[data-test-subj="timeline-favorite-empty-star"]';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ import {
} from '../screens/common/rule_actions';
import { fillIndexConnectorForm, fillEmailConnectorForm } from './common/rule_actions';
import { TOAST_ERROR } from '../screens/shared';
import { SERVER_SIDE_EVENT_COUNT } from '../screens/timeline';
import { ALERTS_TABLE_COUNT } from '../screens/timeline';
import { TIMELINE } from '../screens/timelines';
import { refreshPage } from './security_header';
import { EUI_FILTER_SELECT_ITEM, COMBO_BOX_INPUT } from '../screens/common/controls';
Expand Down Expand Up @@ -669,7 +669,7 @@ export const waitForAlertsToPopulate = async (alertCountThreshold = 1) => {
() => {
refreshPage();
return cy
.get(SERVER_SIDE_EVENT_COUNT)
.get(ALERTS_TABLE_COUNT)
.invoke('text')
.then((countText) => {
const alertCount = parseInt(countText, 10) || 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,19 @@ import '../../../common/mock/match_media';
import { TestProviders } from '../../../common/mock';
import { AlertsTableComponent } from '.';
import { TableId } from '../../../../common/types';
import { APP_ID } from '../../../../common/constants';

describe('AlertsTableComponent', () => {
it('renders correctly', () => {
const wrapper = shallow(
<TestProviders>
<AlertsTableComponent
configId={`${APP_ID}`}
flyoutSize="m"
inputFilters={[]}
tableId={TableId.test}
hasIndexWrite
hasIndexMaintenance
from={'2020-07-07T08:20:18.966Z'}
loading
to={'2020-07-08T08:20:18.966Z'}
globalQuery={{
query: 'query',
language: 'language',
}}
globalFilters={[]}
loadingEventIds={[]}
isSelectAllChecked={false}
showBuildingBlockAlerts={false}
onShowBuildingBlockAlertsChanged={jest.fn()}
showOnlyThreatIndicatorAlerts={false}
onShowOnlyThreatIndicatorAlertsChanged={jest.fn()}
dispatch={jest.fn()}
/>
</TestProviders>
);
Expand Down

0 comments on commit cc9b213

Please sign in to comment.