fix: Disable lazy loading for the Database selector (#16908)

* fix: Disable lazy loading for the Database selector

* Fixes the tests
This commit is contained in:
Michael S. Molina 2021-09-30 09:29:27 -03:00 committed by GitHub
parent 05632b9804
commit ae26967c4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -180,7 +180,7 @@ test('Refresh should work', async () => {
userEvent.click(select);
await waitFor(() => {
expect(SupersetClientGet).toBeCalledTimes(1);
expect(SupersetClientGet).toBeCalledTimes(2);
expect(props.getDbList).toBeCalledTimes(0);
expect(props.getTableList).toBeCalledTimes(0);
expect(props.handleError).toBeCalledTimes(0);
@ -193,8 +193,8 @@ test('Refresh should work', async () => {
userEvent.click(screen.getByRole('button', { name: 'refresh' }));
await waitFor(() => {
expect(SupersetClientGet).toBeCalledTimes(2);
expect(props.getDbList).toBeCalledTimes(0);
expect(SupersetClientGet).toBeCalledTimes(3);
expect(props.getDbList).toBeCalledTimes(1);
expect(props.getTableList).toBeCalledTimes(0);
expect(props.handleError).toBeCalledTimes(0);
expect(props.onDbChange).toBeCalledTimes(0);

View File

@ -253,6 +253,7 @@ export default function DatabaseSelector({
ariaLabel={t('Select database or type database name')}
data-test="select-database"
header={<FormLabel>{t('Database')}</FormLabel>}
lazyLoading={false}
onChange={changeDataBase}
value={currentDb}
placeholder={t('Select database or type database name')}