This is an automated email from the ASF dual-hosted git repository.

jinghuayao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 0af671f  test(native filter): add new native filter test for time 
column filter (#18850)
0af671f is described below

commit 0af671fa255027fa4bbea623d02cef9a8839d77a
Author: Jinghuayao <[email protected]>
AuthorDate: Thu Feb 24 10:24:14 2022 -0800

    test(native filter): add new native filter test for time column filter 
(#18850)
    
    * add new native filter test for time column filter
---
 .../integration/dashboard/nativeFilters.test.ts    | 41 ++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git 
a/superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts
 
b/superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts
index 74785d0..414f14d 100644
--- 
a/superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts
+++ 
b/superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts
@@ -501,6 +501,47 @@ describe('Nativefilters Sanity test', () => {
       .contains('Month')
       .should('be.visible');
   });
+  it('User can create a time column filter', () => {
+    cy.get(nativeFilters.filterFromDashboardView.expand).click({ force: true 
});
+    cy.get(nativeFilters.filterFromDashboardView.createFilterButton)
+      .should('be.visible')
+      .click();
+    cy.get(nativeFilters.filtersPanel.filterTypeInput)
+      .find(nativeFilters.filtersPanel.filterTypeItem)
+      .click({ force: true });
+    cy.get('[label="Time column"]').click({ force: true });
+    cy.get(nativeFilters.modal.container)
+      .find(nativeFilters.filtersPanel.filterName)
+      .click({ force: true })
+      .clear()
+      .type('time column');
+    cy.get(nativeFilters.modal.container)
+      .find(nativeFilters.filtersPanel.datasetName)
+      .click()
+      .type('wb_health_population');
+    cy.get(nativeFilters.silentLoading).should('not.exist');
+    cy.get('[label="wb_health_population"]').click();
+
+    cy.get(nativeFilters.modal.footer)
+      .contains('Save')
+      .should('be.visible')
+      .click();
+    cy.intercept(`/api/v1/chart/data?form_data=**`).as('chart');
+    cy.get(nativeFilters.modal.container).should('not.exist');
+    // assert that native filter is created
+    cy.get(nativeFilters.filterFromDashboardView.filterName)
+      .should('be.visible')
+      .contains('time column');
+    cy.get(nativeFilters.filterFromDashboardView.filterValueInput)
+      .should('be.visible', { timeout: 10000 })
+      .click()
+      .type('year{enter}');
+    cy.get(nativeFilters.applyFilter).click({ force: true });
+    cy.wait('@chart');
+    cy.get(nativeFilters.filterFromDashboardView.filterContent)
+      .contains('year')
+      .should('be.visible');
+  });
 });
 
 xdescribe('Nativefilters', () => {

Reply via email to