Skip to content

Commit

Permalink
adds extra check to see that the selected number of signals is correct
Browse files Browse the repository at this point in the history
  • Loading branch information
MadameSheema committed Mar 12, 2020
1 parent bd9b7b2 commit 193be04
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { NUMBER_OF_SIGNALS, SHOWING_SIGNALS, SIGNALS } from '../screens/detections';
import {
NUMBER_OF_SIGNALS,
SELECTED_SIGNALS,
SHOWING_SIGNALS,
SIGNALS,
} from '../screens/detections';

import {
closeSignals,
Expand Down Expand Up @@ -39,6 +44,11 @@ describe('Detections', () => {

const numberOfSignalsToBeClosed = 3;
selectNumberOfSignals(numberOfSignalsToBeClosed);

cy.get(SELECTED_SIGNALS)
.invoke('text')
.should('eql', `Selected ${numberOfSignalsToBeClosed} signals`);

closeSignals();
waitForSignals();
cy.reload();
Expand All @@ -65,6 +75,11 @@ describe('Detections', () => {

const numberOfSignalsToBeOpened = 1;
selectNumberOfSignals(numberOfSignalsToBeOpened);

cy.get(SELECTED_SIGNALS)
.invoke('text')
.should('eql', `Selected ${numberOfSignalsToBeOpened} signal`);

openSignals();
waitForSignals();
cy.reload();
Expand Down
4 changes: 3 additions & 1 deletion x-pack/legacy/plugins/siem/cypress/screens/detections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export const NUMBER_OF_SIGNALS = '[data-test-subj="server-side-event-count"]';

export const OPEN_CLOSE_SIGNALS_BTN = '[data-test-subj="openCloseSignal"] .siemLinkIcon__label';

export const OPENED_SIGNALS_BTN = '[data-test-subj=openSignals]';
export const OPENED_SIGNALS_BTN = '[data-test-subj="openSignals"]';

export const SELECTED_SIGNALS = '[data-test-subj="selectedSignals"]';

export const SHOWING_SIGNALS = '[data-test-subj="showingSignals"]';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const SignalsUtilityBarComponent: React.FC<SignalsUtilityBarProps> = ({
<UtilityBarGroup>
{canUserCRUD && hasIndexWrite && (
<>
<UtilityBarText>
<UtilityBarText dataTestSubj="selectedSignals">
{i18n.SELECTED_SIGNALS(
showClearSelection ? formattedTotalCount : formattedSelectedEventsCount,
showClearSelection ? totalCount : Object.keys(selectedEventIds).length
Expand Down

0 comments on commit 193be04

Please sign in to comment.