diff --git a/superset-frontend/src/SqlLab/components/SouthPane/Results.tsx b/superset-frontend/src/SqlLab/components/SouthPane/Results.tsx index b5167be61f4b..44e92ceaf91c 100644 --- a/superset-frontend/src/SqlLab/components/SouthPane/Results.tsx +++ b/superset-frontend/src/SqlLab/components/SouthPane/Results.tsx @@ -29,7 +29,7 @@ import { LOCALSTORAGE_MAX_QUERY_AGE_MS } from '../../constants'; const EXTRA_HEIGHT_RESULTS = 8; // we need extra height in RESULTS tab. because the height from props was calculated based on PREVIEW tab. type Props = { - latestQueryId: string; + latestQueryId?: string; height: number; displayLimit: number; defaultQueryLimit: number; diff --git a/superset-frontend/src/SqlLab/components/SouthPane/SouthPane.test.tsx b/superset-frontend/src/SqlLab/components/SouthPane/SouthPane.test.tsx index c978a4ca3233..2e66c2f33c3a 100644 --- a/superset-frontend/src/SqlLab/components/SouthPane/SouthPane.test.tsx +++ b/superset-frontend/src/SqlLab/components/SouthPane/SouthPane.test.tsx @@ -123,6 +123,19 @@ test('should render offline when the state is offline', async () => { expect(getByText(STATUS_OPTIONS.offline)).toBeVisible(); }); +test('should render empty result state when latestQuery is empty', () => { + const { getAllByRole } = render( + , + { + useRedux: true, + initialState: mockState, + }, + ); + + const resultPanel = getAllByRole('tabpanel')[0]; + expect(resultPanel).toHaveTextContent('Run a query to display results'); +}); + test('should render tabs for table preview queries', () => { const { getAllByRole } = render(, { useRedux: true, diff --git a/superset-frontend/src/SqlLab/components/SouthPane/index.tsx b/superset-frontend/src/SqlLab/components/SouthPane/index.tsx index 0bbce99b1c43..941f0f7523c6 100644 --- a/superset-frontend/src/SqlLab/components/SouthPane/index.tsx +++ b/superset-frontend/src/SqlLab/components/SouthPane/index.tsx @@ -144,14 +144,12 @@ const SouthPane = ({ animated={false} > - {latestQueryId && ( - - )} +