diff --git a/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataQueriesTab.test.tsx b/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataQueriesTab.test.tsx index 3fa7b13563c..fe807ace5b2 100644 --- a/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataQueriesTab.test.tsx +++ b/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataQueriesTab.test.tsx @@ -520,6 +520,27 @@ describe('PanelDataQueriesTab', () => { }); expect(dataObj.state.minInterval).toBe('1s'); }); + + it('should update min interval to undefined if empty input', async () => { + const { queriesTab } = await setupScene('panel-1'); + const dataObj = queriesTab.queryRunner; + + expect(dataObj.state.maxDataPoints).toBeUndefined(); + + queriesTab.onQueryOptionsChange({ + dataSource: { name: 'grafana-testdata', type: 'grafana-testdata-datasource', default: true }, + queries: [], + minInterval: '1s', + }); + expect(dataObj.state.minInterval).toBe('1s'); + + queriesTab.onQueryOptionsChange({ + dataSource: { name: 'grafana-testdata', type: 'grafana-testdata-datasource', default: true }, + queries: [], + minInterval: null, + }); + expect(dataObj.state.minInterval).toBe(undefined); + }); }); describe('query caching', () => { diff --git a/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataQueriesTab.tsx b/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataQueriesTab.tsx index 9eb246042fd..9881cca477e 100644 --- a/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataQueriesTab.tsx +++ b/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataQueriesTab.tsx @@ -201,8 +201,8 @@ export class PanelDataQueriesTab extends SceneObjectBase