From e76694dd8408bb70fd0f5c6973420a6898843923 Mon Sep 17 00:00:00 2001 From: Amardeepsingh Siglani Date: Thu, 15 Dec 2022 16:35:00 -0800 Subject: [PATCH 1/3] filtered findings Signed-off-by: Amardeepsingh Siglani --- public/pages/Alerts/components/AlertFlyout/AlertFlyout.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/pages/Alerts/components/AlertFlyout/AlertFlyout.tsx b/public/pages/Alerts/components/AlertFlyout/AlertFlyout.tsx index 8f30e9d5a..ebedd1215 100644 --- a/public/pages/Alerts/components/AlertFlyout/AlertFlyout.tsx +++ b/public/pages/Alerts/components/AlertFlyout/AlertFlyout.tsx @@ -82,7 +82,10 @@ export class AlertFlyout extends React.Component + this.props.alertItem.finding_ids.includes(finding.id) + ); + this.setState({ findingItems: relatedFindings }); } else { errorNotificationToast(notifications, 'retrieve', 'findings', findingRes.error); } From b451af2605649f68c62b0abe5a2d2f2a7005169e Mon Sep 17 00:00:00 2001 From: Amardeepsingh Siglani Date: Fri, 16 Dec 2022 16:54:25 -0800 Subject: [PATCH 2/3] fixed cypress test Signed-off-by: Amardeepsingh Siglani --- cypress/integration/3_alerts.spec.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cypress/integration/3_alerts.spec.js b/cypress/integration/3_alerts.spec.js index a40037503..fe3ba13f4 100644 --- a/cypress/integration/3_alerts.spec.js +++ b/cypress/integration/3_alerts.spec.js @@ -159,12 +159,12 @@ describe('Alerts', () => { cy.get('[data-test-subj="text-details-group-content-detector"]').contains(testDetector.name); // Wait for the findings table to finish loading - cy.contains('Findings (4)', TWENTY_SECONDS_TIMEOUT); + cy.contains('Findings (1)', TWENTY_SECONDS_TIMEOUT); cy.contains('USB Device Plugged', TWENTY_SECONDS_TIMEOUT); // Confirm alert findings contain expected values cy.get('tbody > tr', TWENTY_SECONDS_TIMEOUT) - .should(($tr) => expect($tr, '4 rows').to.have.length(4)) + .should(($tr) => expect($tr, '1 row').to.have.length(1)) .each(($el, $index) => { expect($el, `row number ${$index} timestamp`).to.contain(date); expect($el, `row number ${$index} rule name`).to.contain('USB Device Plugged'); @@ -355,7 +355,7 @@ describe('Alerts', () => { }); // Filter the table to show only "Active" alerts - cy.get('[data-text="Status"]'); + cy.get('[data-text="Status"]').click({ force: true }); cy.get('[class="euiFilterSelect__items"]').within(() => { cy.contains('Acknowledged').click({ force: true }); cy.contains('Active').click({ force: true }); @@ -391,7 +391,7 @@ describe('Alerts', () => { ); // Filter the table to show only "Acknowledged" alerts - cy.get('[data-text="Status"]'); + cy.get('[data-text="Status"]').click({ force: true }); cy.get('[class="euiFilterSelect__items"]').within(() => { cy.contains('Active').click({ force: true }); cy.contains('Acknowledged').click({ force: true }); From 89c695d374274fad42917328c4cd12fbef874c7c Mon Sep 17 00:00:00 2001 From: Amardeepsingh Siglani Date: Mon, 19 Dec 2022 11:12:58 -0800 Subject: [PATCH 3/3] removed breaking change Signed-off-by: Amardeepsingh Siglani --- cypress/integration/3_alerts.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/integration/3_alerts.spec.js b/cypress/integration/3_alerts.spec.js index fe3ba13f4..374261563 100644 --- a/cypress/integration/3_alerts.spec.js +++ b/cypress/integration/3_alerts.spec.js @@ -355,7 +355,7 @@ describe('Alerts', () => { }); // Filter the table to show only "Active" alerts - cy.get('[data-text="Status"]').click({ force: true }); + cy.get('[data-text="Status"]'); cy.get('[class="euiFilterSelect__items"]').within(() => { cy.contains('Acknowledged').click({ force: true }); cy.contains('Active').click({ force: true }); @@ -391,7 +391,7 @@ describe('Alerts', () => { ); // Filter the table to show only "Acknowledged" alerts - cy.get('[data-text="Status"]').click({ force: true }); + cy.get('[data-text="Status"]'); cy.get('[class="euiFilterSelect__items"]').within(() => { cy.contains('Active').click({ force: true }); cy.contains('Acknowledged').click({ force: true });