superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From johnbod...@apache.org
Subject [incubator-superset] 39/43: fixed js tests
Date Fri, 11 Jan 2019 02:22:43 GMT
This is an automated email from the ASF dual-hosted git repository.

johnbodley pushed a commit to branch feature--embeddable-charts-pilot
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git

commit be9b246ef5c00e0e5af504cd7cf8f41eaa03e86a
Author: Conglei Shi <conglei.shi@airbnb.com>
AuthorDate: Mon Dec 17 15:43:07 2018 -0800

    fixed js tests
---
 .../assets/spec/javascripts/explore/utils_spec.jsx | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/superset/assets/spec/javascripts/explore/utils_spec.jsx b/superset/assets/spec/javascripts/explore/utils_spec.jsx
index 323655d..863f5f7 100644
--- a/superset/assets/spec/javascripts/explore/utils_spec.jsx
+++ b/superset/assets/spec/javascripts/explore/utils_spec.jsx
@@ -14,6 +14,10 @@ describe('exploreUtils', () => {
     expect(uri1.toString()).toBe(uri2.toString());
   }
 
+  const expectedPayload = {
+    form_data: formData,
+  };
+
   describe('getExploreUrlAndPayload', () => {
     it('generates proper base url', () => {
       // This assertion is to show clearly the value of location.href
@@ -30,7 +34,7 @@ describe('exploreUtils', () => {
         URI(url),
         URI('/superset/explore/'),
       );
-      expect(payload).toEqual(formData);
+      expect(payload).toEqual(expectedPayload);
     });
     it('generates proper json url', () => {
       const { url, payload } = getExploreUrlAndPayload({
@@ -43,7 +47,7 @@ describe('exploreUtils', () => {
         URI(url),
         URI('/superset/explore_json/'),
       );
-      expect(payload).toEqual(formData);
+      expect(payload).toEqual(expectedPayload);
     });
     it('generates proper json forced url', () => {
       const { url, payload } = getExploreUrlAndPayload({
@@ -57,7 +61,7 @@ describe('exploreUtils', () => {
         URI('/superset/explore_json/')
           .search({ force: 'true' }),
       );
-      expect(payload).toEqual(formData);
+      expect(payload).toEqual(expectedPayload);
     });
     it('generates proper csv URL', () => {
       const { url, payload } = getExploreUrlAndPayload({
@@ -71,7 +75,7 @@ describe('exploreUtils', () => {
         URI('/superset/explore_json/')
           .search({ csv: 'true' }),
       );
-      expect(payload).toEqual(formData);
+      expect(payload).toEqual(expectedPayload);
     });
     it('generates proper standalone URL', () => {
       const { url, payload } = getExploreUrlAndPayload({
@@ -85,7 +89,7 @@ describe('exploreUtils', () => {
         URI('/superset/explore/')
           .search({ standalone: 'true' }),
       );
-      expect(payload).toEqual(formData);
+      expect(payload).toEqual(expectedPayload);
     });
     it('preserves main URLs params', () => {
       const { url, payload } = getExploreUrlAndPayload({
@@ -99,7 +103,7 @@ describe('exploreUtils', () => {
         URI('/superset/explore_json/')
           .search({ foo: 'bar' }),
       );
-      expect(payload).toEqual(formData);
+      expect(payload).toEqual(expectedPayload);
     });
     it('generate proper save slice url', () => {
       const { url, payload } = getExploreUrlAndPayload({
@@ -113,7 +117,7 @@ describe('exploreUtils', () => {
         URI('/superset/explore_json/')
           .search({ foo: 'bar' }),
       );
-      expect(payload).toEqual(formData);
+      expect(payload).toEqual(expectedPayload);
     });
     it('generate proper saveas slice url', () => {
       const { url, payload } = getExploreUrlAndPayload({
@@ -127,7 +131,7 @@ describe('exploreUtils', () => {
         URI('/superset/explore_json/')
           .search({ foo: 'bar' }),
       );
-      expect(payload).toEqual(formData);
+      expect(payload).toEqual(expectedPayload);
     });
   });
 
@@ -199,7 +203,7 @@ describe('exploreUtils', () => {
   describe('getExploreLongUrl', () => {
     it('generates proper base url with form_data', () => {
       compareURI(
-        URI(getExploreLongUrl(formData, 'base')),
+        URI(getExploreLongUrl({ formData, endpointType: 'base' })),
         URI('/superset/explore/').search({ form_data: sFormData }),
       );
     });


Mime
View raw message