mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
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:
parent
05632b9804
commit
ae26967c4e
@ -180,7 +180,7 @@ test('Refresh should work', async () => {
|
|||||||
userEvent.click(select);
|
userEvent.click(select);
|
||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
expect(SupersetClientGet).toBeCalledTimes(1);
|
expect(SupersetClientGet).toBeCalledTimes(2);
|
||||||
expect(props.getDbList).toBeCalledTimes(0);
|
expect(props.getDbList).toBeCalledTimes(0);
|
||||||
expect(props.getTableList).toBeCalledTimes(0);
|
expect(props.getTableList).toBeCalledTimes(0);
|
||||||
expect(props.handleError).toBeCalledTimes(0);
|
expect(props.handleError).toBeCalledTimes(0);
|
||||||
@ -193,8 +193,8 @@ test('Refresh should work', async () => {
|
|||||||
userEvent.click(screen.getByRole('button', { name: 'refresh' }));
|
userEvent.click(screen.getByRole('button', { name: 'refresh' }));
|
||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
expect(SupersetClientGet).toBeCalledTimes(2);
|
expect(SupersetClientGet).toBeCalledTimes(3);
|
||||||
expect(props.getDbList).toBeCalledTimes(0);
|
expect(props.getDbList).toBeCalledTimes(1);
|
||||||
expect(props.getTableList).toBeCalledTimes(0);
|
expect(props.getTableList).toBeCalledTimes(0);
|
||||||
expect(props.handleError).toBeCalledTimes(0);
|
expect(props.handleError).toBeCalledTimes(0);
|
||||||
expect(props.onDbChange).toBeCalledTimes(0);
|
expect(props.onDbChange).toBeCalledTimes(0);
|
||||||
|
@ -253,6 +253,7 @@ export default function DatabaseSelector({
|
|||||||
ariaLabel={t('Select database or type database name')}
|
ariaLabel={t('Select database or type database name')}
|
||||||
data-test="select-database"
|
data-test="select-database"
|
||||||
header={<FormLabel>{t('Database')}</FormLabel>}
|
header={<FormLabel>{t('Database')}</FormLabel>}
|
||||||
|
lazyLoading={false}
|
||||||
onChange={changeDataBase}
|
onChange={changeDataBase}
|
||||||
value={currentDb}
|
value={currentDb}
|
||||||
placeholder={t('Select database or type database name')}
|
placeholder={t('Select database or type database name')}
|
||||||
|
Loading…
Reference in New Issue
Block a user