Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
fix(sqllab): Disable Select All on table selector (apache#24120)
Browse files Browse the repository at this point in the history
  • Loading branch information
justinpark committed May 18, 2023
1 parent e0d9acc commit 2ca8a52
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 @@ -92,7 +92,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 @@ -308,6 +308,7 @@ const TableSelector: FunctionComponent<TableSelectorProps> = ({
mode={tableSelectMode}
value={tableSelectValue}
allowClear={tableSelectMode === 'multiple'}
allowSelectAll={false}
/>
);

Expand Down

0 comments on commit 2ca8a52

Please sign in to comment.