From 391ed8c3d0596d5287ba90386b36d9d16e75bd4f Mon Sep 17 00:00:00 2001 From: "konrad.szwarc" Date: Fri, 21 Apr 2023 16:56:11 +0200 Subject: [PATCH] type returns of helper functions --- .../public/management/cypress/tasks/isolate.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 85cb005ae5e73..b00b567852026 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 @@ -11,7 +11,7 @@ const API_ENDPOINT_ACTION_PATH = '/api/endpoint/action/*'; export const interceptActionRequests = ( cb: (responseBody: ActionDetails) => void, alias: string -) => { +): void => { cy.intercept('POST', API_ENDPOINT_ACTION_PATH, (req) => { req.continue((res) => { const { @@ -23,36 +23,36 @@ export const interceptActionRequests = ( }).as(alias); }; -export const sendActionResponse = (action: ActionDetails) => { +export const sendActionResponse = (action: ActionDetails): void => { cy.task('sendHostActionResponse', { action, state: { state: 'success' }, }); }; -export const isolateHostWithComment = (comment: string, hostname: string) => { +export const isolateHostWithComment = (comment: string, hostname: string): void => { cy.getByTestSubj('isolate-host-action-item').click(); cy.contains(`Isolate host ${hostname} from network.`); cy.getByTestSubj('endpointHostIsolationForm'); cy.getByTestSubj('host_isolation_comment').type(comment); }; -export const releaseHostWithComment = (comment: string, hostname: string) => { +export const releaseHostWithComment = (comment: string, hostname: string): void => { cy.contains(`${hostname} is currently isolated.`); cy.getByTestSubj('endpointHostIsolationForm'); cy.getByTestSubj('host_isolation_comment').type(comment); }; -export const openAlertDetails = () => { +export const openAlertDetails = (): void => { cy.getByTestSubj('expand-event').first().click(); cy.getByTestSubj('take-action-dropdown-btn').click(); }; -export const openCaseAlertDetails = (alertId: string) => { +export const openCaseAlertDetails = (alertId: string): void => { cy.getByTestSubj(`comment-action-show-alert-${alertId}`).click(); cy.getByTestSubj('take-action-dropdown-btn').click(); }; -export const waitForReleaseOption = (alertId: string) => { +export const waitForReleaseOption = (alertId: string): void => { openCaseAlertDetails(alertId); cy.getByTestSubj('event-field-agent.status').then(($status) => { if ($status.find('[title="Isolated"]').length > 0) {