Skip to content

Commit

Permalink
Add query and filter syncing up (#1576) (#1581)
Browse files Browse the repository at this point in the history
Follow up PR of opensearch-project/OpenSearch-Dashboards#8168 to add test to make sure queries and filters are persisted across refresh, and switching between new and legacy tables.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>
(cherry picked from commit fb85e41)

Co-authored-by: Qingyang(Abby) Hu <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] and abbyhu2000 authored Oct 1, 2024
1 parent a97f393 commit ecdeec5
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,32 @@ describe('discover app', { scrollBehavior: false }, () => {

after(() => {});

describe('filters and queries', () => {
after(() => {
cy.get('[data-test-subj~="filter-key-extension.raw"]').click();
cy.getElementByTestId(`deleteFilter`).click();
cy.switchDiscoverTable('legacy');
});
it('should persist across refresh', function () {
// Set up query and filter
cy.setTopNavQuery('response:200');
cy.submitFilterFromDropDown('extension.raw', 'is one of', 'jpg');
cy.reload();
cy.getElementByTestId(`queryInput`).should('have.text', 'response:200');
cy.get('[data-test-subj~="filter-key-extension.raw"]').should(
'be.visible'
);
});

it('should persist across switching table', function () {
cy.switchDiscoverTable('new');
cy.getElementByTestId(`queryInput`).should('have.text', 'response:200');
cy.get('[data-test-subj~="filter-key-extension.raw"]').should(
'be.visible'
);
});
});

describe('save search', () => {
const saveSearch1 = 'Save Search # 1';
const saveSearch2 = 'Modified Save Search # 1';
Expand Down

0 comments on commit ecdeec5

Please sign in to comment.