Skip to content

Commit

Permalink
Don't need to force DatePickerMenu open (#1358)
Browse files Browse the repository at this point in the history
Due to opensearch-project/OpenSearch-Dashboards#6167,
we don't have the double render issue when global state is updated.

Therefore we don't need to call makeDatePickerMenuOpen function, which is just
to reclick the DatePickerToggle to make the menu re-open. This function is a tmp
solution to allow test passing.

In this PR, we will remove the function and all the usages.

Signed-off-by: Anan <ananzh@amazon.com>
(cherry picked from commit 2881c0f)
  • Loading branch information
ananzh authored and github-actions[bot] committed Jun 6, 2024
1 parent d2e035e commit d4468c8
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,12 @@ describe('discover app', { scrollBehavior: false }, () => {
.should('be.visible')
.clear()
.type('2');

cy.makeDatePickerMenuOpen();
cy.getElementByTestId('superDatePickerToggleRefreshButton').click();

// Let auto refresh run
cy.wait(100);

// Close the auto refresh
cy.makeDatePickerMenuOpen();
cy.getElementByTestId('superDatePickerToggleRefreshButton').click();

// Check the timestamp of the last request, it should be different than the first timestamp
Expand Down
12 changes: 0 additions & 12 deletions cypress/utils/dashboards/data_explorer/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,18 +156,6 @@ Cypress.Commands.add('switchDiscoverTable', (name) => {
});
});

Cypress.Commands.add('makeDatePickerMenuOpen', () => {
cy.get(
'[class="euiFormControlLayout euiFormControlLayout--group euiSuperDatePicker"]'
).then(($popover) => {
// Check if the popover does not have the 'euiPopover-isOpen' class
if (!$popover.hasClass('euiPopover-isOpen')) {
// If not open, click the button to open the quick menu
cy.getElementByTestId('superDatePickerToggleQuickMenuButton').click();
}
});
});

function checkForElementVisibility() {
cy.getElementsByTestIds('queryInput')
.should('be.visible')
Expand Down
1 change: 0 additions & 1 deletion cypress/utils/dashboards/data_explorer/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ declare namespace Cypress {
clearSaveQuery(): Chainable<any>;
deleteSaveQuery(name: string): Chainable<any>;
switchDiscoverTable(name: string): Chainable<any>;
makeDatePickerMenuOpen(): Chainable<any>;
}
}

0 comments on commit d4468c8

Please sign in to comment.