michellethomas commented on a change in pull request #5924: [cypress] Add 
integration test for area, pie, world map
URL: 
https://github.com/apache/incubator-superset/pull/5924#discussion_r218626709
 
 

 ##########
 File path: superset/assets/cypress/integration/explore/visualizations/pie.js
 ##########
 @@ -0,0 +1,54 @@
+describe('Pie', () => {
+  const PIE_FORM_DATA = {
+    datasource: '3__table',
+    viz_type: 'pie',
+    slice_id: 55,
+    url_params: {},
+    granularity_sqla: 'ds',
+    time_grain_sqla: 'P1D',
+    time_range: '100 years ago : now',
+    metric: 'sum__num',
+    adhoc_filters: [],
+    groupby: ['gender'],
+    row_limit: 50000,
+    pie_label_type: 'key',
+    donut: false,
+    show_legend: true,
+    show_labels: true,
+    labels_outside: true,
+    color_scheme: 'bnbColors',
+  };
+
+  function verify(formData) {
+    cy.visitChartByParams(JSON.stringify(formData));
+    cy.verifySliceSuccess({ waitAlias: '@getJson', chartSelector: 'svg' });
+  }
+
+  beforeEach(() => {
+    cy.server();
+    cy.login();
+    cy.route('POST', '/superset/explore_json/**').as('getJson');
+  });
+
+  it('works with ad-hoc metric', () => {
+    verify(PIE_FORM_DATA);
+    cy.get('.chart-container .nv-pie .nv-slice path').should('have.length', 2);
+  });
+
+  it('works with simple filter', () => {
+    verify({
+      ...PIE_FORM_DATA,
+      adhoc_filters: [{
+        expressionType: 'SIMPLE',
+        subject: 'gender',
+        operator: '==',
+        comparator: 'boy',
+        clause: 'WHERE',
+        sqlExpression: null,
+        fromFormData: true,
+        filterOptionName: 'filter_tqx1en70hh_7nksse7nqic',
+      }],
 
 Review comment:
   If you rebase on 
[this](https://github.com/apache/incubator-superset/pull/5901) change you can 
import and use the `SIMPLE_FILTER` here.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to