Dashboards: Fix folder picker not showing correct results when typing too fast (#50303)

* Use callback form for loadOptions in folder picker

* clean up

* fix other tests

* clarify comment
This commit is contained in:
Josh Hunt
2022-06-10 15:54:21 +01:00
committed by GitHub
parent 307a0d4538
commit 32d4f6ac60
4 changed files with 20 additions and 6 deletions

View File

@@ -19,7 +19,7 @@ jest.mock('@grafana/runtime', () => ({
}));
setBackendSrv({
get: jest.fn().mockResolvedValue({}),
get: jest.fn().mockResolvedValue([]),
} as any);
describe('DashboardSettings', () => {

View File

@@ -5,11 +5,16 @@ import { selectOptionInTest } from 'test/helpers/selectOptionInTest';
import { byRole } from 'testing-library-selector';
import { selectors } from '@grafana/e2e-selectors';
import { setBackendSrv } from '@grafana/runtime';
import { DashboardModel } from '../../state';
import { GeneralSettingsUnconnected as GeneralSettings, Props } from './GeneralSettings';
setBackendSrv({
get: jest.fn().mockResolvedValue([]),
} as any);
const setupTestContext = (options: Partial<Props>) => {
const defaults: Props = {
dashboard: {