Skip to content

Commit

Permalink
Add unit tests to ProcessTreeAlerts component
Browse files Browse the repository at this point in the history
  • Loading branch information
Zizhou Wang committed Dec 7, 2021
1 parent db18b63 commit 1ee6b41
Showing 1 changed file with 11 additions and 3 deletions.
Expand Up @@ -45,7 +45,7 @@ export function ProcessTreeAlerts({ alerts }: ProcessTreeAlertsDeps) {
const { name, query, severity } = rule;

return (
<EuiText key={uuid} size="s">
<EuiText key={uuid} size="s" data-test-subj={`sessionViewAlertDetail-${uuid}`}>
<EuiFlexGroup>
<EuiFlexItem>
<h6>
Expand Down Expand Up @@ -77,7 +77,11 @@ export function ProcessTreeAlerts({ alerts }: ProcessTreeAlertsDeps) {
{event.action}
<EuiSpacer />
<div>
<EuiButton size="s" href={getRuleUrl(alert)}>
<EuiButton
size="s"
href={getRuleUrl(alert)}
data-test-subj={`sessionViewAlertDetailViewRule-${uuid}`}
>
<FormattedMessage id="xpack.sessionView.viewRule" defaultMessage="View rule" />
</EuiButton>
</div>
Expand All @@ -92,5 +96,9 @@ export function ProcessTreeAlerts({ alerts }: ProcessTreeAlertsDeps) {
);
};

return <div css={styles.container}>{alerts.map(renderAlertDetails)}</div>;
return (
<div css={styles.container} data-test-subj="sessionViewAlertDetails">
{alerts.map(renderAlertDetails)}
</div>
);
}

0 comments on commit 1ee6b41

Please sign in to comment.