diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover.spec.js index 9fccc0265..a8b0a349f 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover.spec.js @@ -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';