From 2b0757451204aef7486c8d8d071fd841dfeb78b0 Mon Sep 17 00:00:00 2001 From: "konrad.szwarc" Date: Mon, 24 Apr 2023 14:57:54 +0200 Subject: [PATCH] type returns of helper functions --- .../management/cypress/e2e/endpoint/isolate.cy.ts | 2 +- .../public/management/cypress/tasks/isolate.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint/isolate.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint/isolate.cy.ts index 12a974776a38c..db486a6478e1a 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint/isolate.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint/isolate.cy.ts @@ -84,7 +84,7 @@ describe('Isolate command', () => { cy.getByTestSubj('hostIsolateConfirmButton').click(); cy.contains(`Isolation on host ${endpointHostname} successfully submitted`); cy.getByTestSubj('euiFlyoutCloseButton').click(); - cy.getByTestSubj('rowIsolationStatus').should('contain.text', 'Isolated'); + cy.getByTestSubj('rowHostStatus-actionStatuses').should('contain.text', 'Isolated'); filterOutIsolatedHosts(); checkEndpointListForIsolatedHosts(); diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/isolate.ts b/x-pack/plugins/security_solution/public/management/cypress/tasks/isolate.ts index 6c400da0b5888..4644faaca2abf 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/tasks/isolate.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/tasks/isolate.ts @@ -74,7 +74,7 @@ export const visitRuleAlerts = (ruleName: string) => { cy.visit('/app/security/rules'); cy.contains(ruleName).click(); }; -export const checkFlyoutEndpointIsolation = () => { +export const checkFlyoutEndpointIsolation = (): void => { cy.getByTestSubj('event-field-agent.status').then(($status) => { if ($status.find('[title="Isolated"]').length > 0) { cy.contains('Release host').click(); @@ -90,7 +90,7 @@ export const checkFlyoutEndpointIsolation = () => { }); }; -export const toggleRuleOffAndOn = (ruleName: string) => { +export const toggleRuleOffAndOn = (ruleName: string): void => { cy.visit('/app/security/rules'); cy.wait(2000); cy.contains(ruleName) @@ -104,7 +104,7 @@ export const toggleRuleOffAndOn = (ruleName: string) => { }); }; -export const filterOutEndpoints = (endpointHostname: string) => { +export const filterOutEndpoints = (endpointHostname: string): void => { cy.getByTestSubj('filters-global-container').within(() => { cy.getByTestSubj('queryInput').click().type(`host.hostname : "${endpointHostname}"`); cy.getByTestSubj('querySubmitButton').click(); @@ -124,12 +124,12 @@ export const createAgentPolicyTask = ( }).then(cb); }; -export const filterOutIsolatedHosts = () => { +export const filterOutIsolatedHosts = (): void => { cy.getByTestSubj('adminSearchBar').click().type('united.endpoint.Endpoint.state.isolation: true'); cy.getByTestSubj('querySubmitButton').click(); }; -export const checkEndpointListForIsolatedHosts = (expectIsolated = true) => { +export const checkEndpointListForIsolatedHosts = (expectIsolated = true): void => { const chainer = expectIsolated ? 'contain.text' : 'not.contain.text'; cy.getByTestSubj('endpointListTable').within(() => { cy.get('tbody tr').each(($tr) => {