diff --git a/superset-frontend/src/components/TableSelector/TableSelector.test.tsx b/superset-frontend/src/components/TableSelector/TableSelector.test.tsx index f6107d4ca..78af066ce 100644 --- a/superset-frontend/src/components/TableSelector/TableSelector.test.tsx +++ b/superset-frontend/src/components/TableSelector/TableSelector.test.tsx @@ -95,7 +95,26 @@ test('renders with default props', async () => { }); }); -test('renders table options', async () => { +test('skips select all options', async () => { + fetchMock.get(schemaApiRoute, { result: ['test_schema'] }); + fetchMock.get(tablesApiRoute, getTableMockFunction()); + + const props = createProps(); + render(, { + useRedux: true, + store, + }); + const tableSelect = screen.getByRole('combobox', { + name: 'Select table or type to search tables', + }); + userEvent.click(tableSelect); + expect( + await screen.findByRole('option', { name: 'table_a' }), + ).toBeInTheDocument(); + expect(screen.queryByRole('option', { name: /Select All/i })).toBeFalsy(); +}); + +test('renders table options without Select All option', async () => { fetchMock.get(schemaApiRoute, { result: ['test_schema'] }); fetchMock.get(tablesApiRoute, getTableMockFunction()); diff --git a/superset-frontend/src/components/TableSelector/index.tsx b/superset-frontend/src/components/TableSelector/index.tsx index 6fcbdb3a5..7c2a809e5 100644 --- a/superset-frontend/src/components/TableSelector/index.tsx +++ b/superset-frontend/src/components/TableSelector/index.tsx @@ -297,6 +297,7 @@ const TableSelector: FunctionComponent = ({ mode={tableSelectMode} value={tableSelectValue} allowClear={tableSelectMode === 'multiple'} + allowSelectAll={false} /> );