You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ju...@apache.org on 2023/04/25 12:58:38 UTC

[superset] branch master updated: fix(sqllab): test failed due to legacy api url (#23805)

This is an automated email from the ASF dual-hosted git repository.

justinpark pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 7e4be7d1ea fix(sqllab): test failed due to legacy api url (#23805)
7e4be7d1ea is described below

commit 7e4be7d1eab0265d0098b05d33eb2003671dddca
Author: JUST.in DO IT <ju...@airbnb.com>
AuthorDate: Tue Apr 25 05:58:28 2023 -0700

    fix(sqllab): test failed due to legacy api url (#23805)
---
 .../ExploreCtasResultsButton/ExploreCtasResultsButton.test.tsx     | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/ExploreCtasResultsButton.test.tsx b/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/ExploreCtasResultsButton.test.tsx
index 1f3382505b..e107c5109d 100644
--- a/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/ExploreCtasResultsButton.test.tsx
+++ b/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/ExploreCtasResultsButton.test.tsx
@@ -32,7 +32,7 @@ import ExploreCtasResultsButton, {
 const middlewares = [thunk];
 const mockStore = configureStore(middlewares);
 
-const getOrCreateTableEndpoint = `glob:*/superset/get_or_create_table/`;
+const getOrCreateTableEndpoint = `glob:*/api/v1/dataset/get_or_create/`;
 
 const setup = (props: Partial<ExploreCtasResultsButtonProps>, store?: Store) =>
   render(
@@ -63,7 +63,7 @@ describe('ExploreCtasResultsButton', () => {
 
     postFormSpy.mockClear();
     fetchMock.reset();
-    fetchMock.post(getOrCreateTableEndpoint, { table_id: 1234 });
+    fetchMock.post(getOrCreateTableEndpoint, { result: { table_id: 1234 } });
 
     fireEvent.click(getByText('Explore'));
 
@@ -82,8 +82,7 @@ describe('ExploreCtasResultsButton', () => {
     postFormSpy.mockClear();
     fetchMock.reset();
     fetchMock.post(getOrCreateTableEndpoint, {
-      status: 500,
-      body: { message: 'Unexpected all to v1 API' },
+      throws: new Error('Unexpected all to v1 API'),
     });
 
     fireEvent.click(getByText('Explore'));