Skip to content

Commit

Permalink
type returns of helper functions
Browse files Browse the repository at this point in the history
  • Loading branch information
szwarckonrad committed Apr 24, 2023
1 parent 7aea2b5 commit 2b07574
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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)
Expand All @@ -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();
Expand All @@ -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) => {
Expand Down

0 comments on commit 2b07574

Please sign in to comment.