mirror of
https://github.com/apache/superset.git
synced 2024-09-16 10:39:55 -04:00
fix(ssh_tunnel): Fix bug on database edition for databases with ssh tunnels (#23006)
Co-authored-by: Lyndsi Kay Williams <55605634+lyndsiWilliams@users.noreply.github.com>
This commit is contained in:
parent
7bb9b810ee
commit
ddd8d17aa4
@ -1510,6 +1510,27 @@ describe('DatabaseModal', () => {
|
||||
expect(allowFileUploadText).not.toBeInTheDocument();
|
||||
expect(schemasForFileUploadText).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('if the SSH Tunneling toggle is not displayed, nothing should get displayed', async () => {
|
||||
const SSHTunnelingToggle = screen.queryByTestId('ssh-tunnel-switch');
|
||||
expect(SSHTunnelingToggle).not.toBeInTheDocument();
|
||||
const SSHTunnelServerAddressInput = screen.queryByTestId(
|
||||
'ssh-tunnel-server_address-input',
|
||||
);
|
||||
expect(SSHTunnelServerAddressInput).not.toBeInTheDocument();
|
||||
const SSHTunnelServerPortInput = screen.queryByTestId(
|
||||
'ssh-tunnel-server_port-input',
|
||||
);
|
||||
expect(SSHTunnelServerPortInput).not.toBeInTheDocument();
|
||||
const SSHTunnelUsernameInput = screen.queryByTestId(
|
||||
'ssh-tunnel-username-input',
|
||||
);
|
||||
expect(SSHTunnelUsernameInput).not.toBeInTheDocument();
|
||||
const SSHTunnelPasswordInput = screen.queryByTestId(
|
||||
'ssh-tunnel-password-input',
|
||||
);
|
||||
expect(SSHTunnelPasswordInput).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
describe('DatabaseModal w errors as objects', () => {
|
||||
|
@ -1154,10 +1154,10 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
||||
}, [passwordsNeeded]);
|
||||
|
||||
useEffect(() => {
|
||||
if (db) {
|
||||
if (db && isSSHTunneling) {
|
||||
setUseSSHTunneling(!isEmpty(db?.ssh_tunnel));
|
||||
}
|
||||
}, [db]);
|
||||
}, [db, isSSHTunneling]);
|
||||
|
||||
const onDbImport = async (info: UploadChangeParam) => {
|
||||
setImportingErrorMessage('');
|
||||
|
Loading…
Reference in New Issue
Block a user