Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
userEvent,
within,
waitFor,
fireEvent,
} from 'spec/helpers/testing-library';
import { getExtensionsRegistry } from '@superset-ui/core';
import setupCodeOverrides from 'src/setup/setupCodeOverrides';
Expand Down Expand Up @@ -423,6 +424,27 @@ describe('DatabaseModal', () => {
expect(footer).toBeEmptyDOMElement();
});

test('shows database options when pasting text in the select', async () => {
setup();

const modal = await screen.findByRole('dialog');
expect(modal).toBeInTheDocument();

// Find the select input (not opening the dropdown)
const selectInput = screen.getByRole('combobox');
expect(selectInput).toBeInTheDocument();

// Simulate focusing the input
userEvent.click(selectInput);

// Simulate pasting text into the input
expect(() =>
fireEvent.paste(selectInput, {
clipboardData: { getData: () => 'post' },
}),
).not.toThrow();
});

test('renders the "Basic" tab of SQL Alchemy form (step 2 of 2) correctly', async () => {
setup();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
// eslint-disable-next-line camelcase
(db: DatabaseObject) => db.name === database_name,
)[0];
if (!selectedDbModel) return;
const {
engine,
parameters,
Expand Down
Loading