Skip to content

Commit

Permalink
fix: review feedback cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
logeekal committed Mar 28, 2024
1 parent 7360c8c commit 84fe0fb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ import {
openHostDetailsFlyout,
openUserDetailsFlyout,
} from '../../../../tasks/unified_timeline';
import { GET_UNIFIED_DATA_GRID_CELL_HEADER } from '../../../../screens/unified_timeline';
import {
GET_UNIFIED_DATA_GRID_CELL_HEADER,
HOST_DETAILS_FLYOUT,
TIMELINE_DETAILS_FLYOUT,
USER_DETAILS_FLYOUT,
} from '../../../../screens/unified_timeline';
import { GET_DISCOVER_DATA_GRID_CELL_HEADER } from '../../../../screens/discover';
import { addFieldToTable, removeFieldFromTable } from '../../../../tasks/discover';
import { login } from '../../../../tasks/login';
Expand Down Expand Up @@ -54,13 +59,15 @@ describe(
it('should be able to open/close details details/host/user flyout', () => {
cy.log('Event Details Flyout');
openEventDetailsFlyout(0);
cy.get(TIMELINE_DETAILS_FLYOUT).should('be.visible');
closeTimelineFlyout();
cy.log('Host Details Flyout');
openHostDetailsFlyout(0);
cy.get(HOST_DETAILS_FLYOUT).should('be.visible');
closeTimelineFlyout();
cy.log('User Details Flyout');
openUserDetailsFlyout(0);
closeTimelineFlyout();
cy.get(USER_DETAILS_FLYOUT).should('be.visible');
});
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const addFieldToTable = (fieldId: string) => {
};

export const removeFieldFromTable = (fieldId: string) => {
cy.get(GET_DISCOVER_COLUMN_TOGGLE_BTN(fieldId)).first().trigger('click');
cy.get(GET_DISCOVER_COLUMN_TOGGLE_BTN(fieldId)).first().click();
};

export const createAdHocDataView = (name: string, indexPattern: string, save: boolean = false) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,23 @@
import {
GET_UNIFIED_DATA_GRID_CELL,
GET_UNIFIED_DATA_GRID_CELL_HEADER,
HOST_DETAILS_FLYOUT,
HOST_DETAILS_LINK,
TIMELINE_DETAILS_FLYOUT,
TIMELINE_DETAILS_FLYOUT_BTN,
TIMELINE_DETAILS_FLYOUT_CLOSE_BTN,
USER_DETAILS_FLYOUT,
USER_DETAILS_LINK,
} from '../screens/unified_timeline';

export const openEventDetailsFlyout = (rowIndex: number) => {
cy.get(TIMELINE_DETAILS_FLYOUT_BTN).eq(rowIndex).click();
cy.get(TIMELINE_DETAILS_FLYOUT).should('be.visible');
};

export const openHostDetailsFlyout = (rowIndex: number) => {
cy.get(HOST_DETAILS_LINK).eq(rowIndex).click();
cy.get(HOST_DETAILS_FLYOUT).should('be.visible');
};

export const openUserDetailsFlyout = (rowIndex: number) => {
cy.get(USER_DETAILS_LINK).eq(rowIndex).click();
cy.get(USER_DETAILS_FLYOUT).should('be.visible');
};

export const getUnifiedTableHeaderColumn = (columnName: string) => {
Expand Down

0 comments on commit 84fe0fb

Please sign in to comment.