villebro commented on a change in pull request #11712:
URL: 
https://github.com/apache/incubator-superset/pull/11712#discussion_r528600288



##########
File path: 
superset-frontend/cypress-base/cypress/integration/dashboard/url_params.test.js
##########
@@ -36,26 +37,26 @@ describe('Dashboard form data', () => {
   });
 
   it('should apply url params and queryFields to slice requests', () => {
-    const aliases = [];
-    dashboard.slices.forEach(slice => {
-      const { slice_id: id } = slice;
-      const isLegacy = isLegacyChart(slice.form_data.viz_type);
-      const route = 
`/superset/explore_json/?form_data={"slice_id":${id}}&dashboard_id=${dashboard.id}`;
-      const alias = `getJson_${id}`;
-      // TODO(villebro): enable V1 charts
-      if (isLegacy) {
-        aliases.push(`@${alias}`);
-        cy.route('POST', route).as(alias);
-      }
-    });
-
+    const aliases = getChartAliases(dashboard.slices);
+    // wait and verify one-by-one
     cy.wait(aliases).then(requests => {
-      requests.forEach(xhr => {
-        const requestFormData = xhr.request.body;
-        const requestParams = JSON.parse(requestFormData.get('form_data'));
-        expect(requestParams).to.have.property('queryFields');
-        expect(requestParams.url_params).deep.eq(urlParams);
-      });
+      return Promise.all(
+        requests.map(async xhr => {
+          expect(xhr.status).to.eq(200);
+          const responseBody = await readResponseBlob(xhr.response.body);
+
+          if (isLegacyResponse(responseBody)) {
+            const requestFormData = xhr.request.body;
+            const requestParams = JSON.parse(requestFormData.get('form_data'));
+            expect(requestParams).to.have.property('queryFields');

Review comment:
       This isn't being checked on v1 api. However, let's not add it, as we're 
in the process of removing it anyway.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to