Skip to content

Commit

Permalink
fix(sqllab): Disable Select All on table selector (#24120)
Browse files Browse the repository at this point in the history
  • Loading branch information
justinpark authored May 18, 2023
1 parent 2222073 commit 5159861
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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(<TableSelector {...props} tableSelectMode="multiple" />, {
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());

Expand Down
1 change: 1 addition & 0 deletions superset-frontend/src/components/TableSelector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ const TableSelector: FunctionComponent<TableSelectorProps> = ({
mode={tableSelectMode}
value={tableSelectValue}
allowClear={tableSelectMode === 'multiple'}
allowSelectAll={false}
/>
);

Expand Down

0 comments on commit 5159861

Please sign in to comment.