From 18659020be63c630a3234b370594b77228327a43 Mon Sep 17 00:00:00 2001 From: justin-park Date: Thu, 25 May 2023 09:21:44 -0700 Subject: [PATCH] Revert "fix(explore): rendering regression on standalone (#24177)" This reverts commit 461393279889bb3132c2672f94d95c2443a75239. --- .../explore/components/ExploreChartPanel.jsx | 6 +----- .../ExploreViewContainer.test.tsx | 17 +---------------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/superset-frontend/src/explore/components/ExploreChartPanel.jsx b/superset-frontend/src/explore/components/ExploreChartPanel.jsx index 5d563ee69c4fd..1e57e0750e42a 100644 --- a/superset-frontend/src/explore/components/ExploreChartPanel.jsx +++ b/superset-frontend/src/explore/components/ExploreChartPanel.jsx @@ -418,11 +418,7 @@ const ExploreChartPanel = ({ if (!bodyClasses.includes(standaloneClass)) { document.body.className += ` ${standaloneClass}`; } - return ( -
- {standaloneChartBody} -
- ); + return standaloneChartBody; } return ( diff --git a/superset-frontend/src/explore/components/ExploreViewContainer/ExploreViewContainer.test.tsx b/superset-frontend/src/explore/components/ExploreViewContainer/ExploreViewContainer.test.tsx index 6b4ec8be00ce6..4f3b4d8dd05ee 100644 --- a/superset-frontend/src/explore/components/ExploreViewContainer/ExploreViewContainer.test.tsx +++ b/superset-frontend/src/explore/components/ExploreViewContainer/ExploreViewContainer.test.tsx @@ -94,19 +94,14 @@ fetchMock.get('glob:*/api/v1/explore/form_data*', {}); fetchMock.get('glob:*/api/v1/chart/favorite_status*', { result: [{ value: true }], }); -fetchMock.get('glob:*/api/v1/chart/*', { - result: {}, -}); const defaultPath = '/explore/'; const renderWithRouter = ({ search = '', overridePathname, - initialState = reduxState, }: { search?: string; overridePathname?: string; - initialState?: object; } = {}) => { const path = overridePathname ?? defaultPath; Object.defineProperty(window, 'location', { @@ -120,7 +115,7 @@ const renderWithRouter = ({ , - { useRedux: true, initialState }, + { useRedux: true, initialState: reduxState }, ); }; @@ -148,16 +143,6 @@ test('generates a new form_data param when none is available', async () => { replaceState.mockRestore(); }); -test('renders chart in standalone mode', () => { - const { queryByTestId } = renderWithRouter({ - initialState: { - ...reduxState, - explore: { ...reduxState.explore, standalone: true }, - }, - }); - expect(queryByTestId('standalone-app')).toBeTruthy(); -}); - test('generates a different form_data param when one is provided and is mounting', async () => { const replaceState = jest.spyOn(window.history, 'replaceState'); await waitFor(() => renderWithRouter({ search: SEARCH }));