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



##########
File path: 
superset-frontend/cypress-base/cypress/integration/dashboard/filter.test.ts
##########
@@ -93,20 +90,30 @@ describe('Dashboard filter', () => {
     cy.get('.Select__menu').first().contains('South Asia').click();
 
     cy.get('.filter_box button').click({ force: true });
-
-    // wait again after applied filters
     cy.wait(aliases.filter(x => x !== getAlias(filterId))).then(requests => {
-      requests.forEach(xhr => {
-        const requestFormData = xhr.request.body as FormData;
-        const requestParams = JSON.parse(
-          requestFormData.get('form_data') as string,
-        );
-        expect(requestParams.extra_filters[0]).deep.eq({
-          col: 'region',
-          op: '==',
-          val: 'South Asia',
-        });
-      });
+      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 as FormData;
+            const requestParams = JSON.parse(
+              requestFormData.get('form_data') as string,
+            );
+            expect(requestParams.extra_filters[0]).deep.eq({
+              col: 'region',
+              op: '==',
+              val: 'South Asia',
+            });
+          } else {
+            responseBody.result.forEach((element: any) => {
+              expect(element.applied_filters[0]).deep.eq({ column: 'region' });
+              expect(element.data[0]).to.have.property('region', 'South Asia');
+              expect(element.data).to.have.length(1);
+            });

Review comment:
       The legacy test is asserting the request, while the v1 test is asserting 
the response. Is it possible to check the v1 request here?




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