diff --git a/packages/grafana-ui/src/components/SingleStatShared/SingleStatBaseOptions.test.ts b/packages/grafana-ui/src/components/SingleStatShared/SingleStatBaseOptions.test.ts index 72a4afc10ae..084712e90c4 100644 --- a/packages/grafana-ui/src/components/SingleStatShared/SingleStatBaseOptions.test.ts +++ b/packages/grafana-ui/src/components/SingleStatShared/SingleStatBaseOptions.test.ts @@ -198,6 +198,18 @@ describe('sharedSingleStatMigrationHandler', () => { expect(panel.fieldConfig.defaults.max).toBe(undefined); }); + it('change from angular singlestat with tableColumn set', () => { + const old: any = { + angular: { + tableColumn: 'info', + }, + }; + const panel = {} as PanelModel; + const newOptions = sharedSingleStatPanelChangedHandler(panel, 'singlestat', old); + expect(newOptions.reduceOptions.calcs).toEqual(['mean']); + expect(newOptions.reduceOptions.fields).toBe('/^info$/'); + }); + it('change from angular singlestat with no enabled gauge', () => { const old: any = { angular: { diff --git a/packages/grafana-ui/src/components/SingleStatShared/SingleStatBaseOptions.ts b/packages/grafana-ui/src/components/SingleStatShared/SingleStatBaseOptions.ts index 296f236f636..9f1382bd58f 100644 --- a/packages/grafana-ui/src/components/SingleStatShared/SingleStatBaseOptions.ts +++ b/packages/grafana-ui/src/components/SingleStatShared/SingleStatBaseOptions.ts @@ -55,7 +55,7 @@ function migrateFromAngularSinglestat(panel: PanelModel