Skip to content

Commit

Permalink
fix(sqllab): test failed due to legacy api url (apache#23805)
Browse files Browse the repository at this point in the history
  • Loading branch information
justinpark authored and sebastianliebscher committed Apr 28, 2023
1 parent 31a6056 commit f68a30d
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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'));

Expand All @@ -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'));
Expand Down

0 comments on commit f68a30d

Please sign in to comment.