williaster commented on a change in pull request #5693: Adding simple Cypress 
tests
URL: 
https://github.com/apache/incubator-superset/pull/5693#discussion_r214477255
 
 

 ##########
 File path: superset/assets/cypress/integration/explore/visualization_tests.js
 ##########
 @@ -0,0 +1,54 @@
+// ***********************************************
+// Tests for visualization types
+// ***********************************************
+
+const FORM_DATA_DEFAULTS = {
+  datasource: '3__table',
+  viz_type: 'line',
+  granularity_sqla: 'ds',
+  time_grain_sqla: null,
+  time_range: '100+years+ago+:+now',
+  adhoc_filters: [],
+  groupby: [],
+  limit: null,
+  timeseries_limit_metric: null,
+  order_desc: false,
+  contribution: false,
+};
+
+describe('Line', function () {
+  it('Test line chart with adhoc metric', function () {
+    cy.server();
+    cy.login();
+
+    const metrics = [{
+      expressionType: 'SIMPLE',
+      column: {
+        id: 336,
+        column_name: 'num',
+        verbose_name: null,
+        description: null,
+        expression: '',
+        filterable: false,
+        groupby: false,
+        is_dttm: false,
+        type: 'BIGINT',
+        database_expression: null,
+        python_date_format: null,
+        optionName: '_col_num',
+      },
+      aggregate: 'SUM',
+      sqlExpression: null,
+      hasCustomLabel: false,
+      fromFormData: false,
+      label: 'SUM(num)',
+      optionName: 'metric_1de0s4viy5d_ly7y8k6ghvk',
+    }];
+
+    const formData = Object.assign({}, FORM_DATA_DEFAULTS, { metrics });
 
 Review comment:
   because it's modern javascript and part of the [airbnb best 
practices](https://github.com/airbnb/javascript#objects--rest-spread). I think 
we should strive to follow them, and we should have this lint rule enabled ... 
but we don't because we have a lot turned off which arguably should be on.

----------------------------------------------------------------
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