Skip to content

Commit fb85e41

Browse files
authored
Add query and filter syncing up (#1576)
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]>
1 parent 17cb4c4 commit fb85e41

File tree

1 file changed

+26
-0
lines changed
  • cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer

1 file changed

+26
-0
lines changed

cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover.spec.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,32 @@ describe('discover app', { scrollBehavior: false }, () => {
6363

6464
after(() => {});
6565

66+
describe('filters and queries', () => {
67+
after(() => {
68+
cy.get('[data-test-subj~="filter-key-extension.raw"]').click();
69+
cy.getElementByTestId(`deleteFilter`).click();
70+
cy.switchDiscoverTable('legacy');
71+
});
72+
it('should persist across refresh', function () {
73+
// Set up query and filter
74+
cy.setTopNavQuery('response:200');
75+
cy.submitFilterFromDropDown('extension.raw', 'is one of', 'jpg');
76+
cy.reload();
77+
cy.getElementByTestId(`queryInput`).should('have.text', 'response:200');
78+
cy.get('[data-test-subj~="filter-key-extension.raw"]').should(
79+
'be.visible'
80+
);
81+
});
82+
83+
it('should persist across switching table', function () {
84+
cy.switchDiscoverTable('new');
85+
cy.getElementByTestId(`queryInput`).should('have.text', 'response:200');
86+
cy.get('[data-test-subj~="filter-key-extension.raw"]').should(
87+
'be.visible'
88+
);
89+
});
90+
});
91+
6692
describe('save search', () => {
6793
const saveSearch1 = 'Save Search # 1';
6894
const saveSearch2 = 'Modified Save Search # 1';

0 commit comments

Comments
 (0)