diff --git a/public/app/plugins/datasource/cloudwatch/components/MetricStatEditor/MetricStatEditor.test.tsx b/public/app/plugins/datasource/cloudwatch/components/MetricStatEditor/MetricStatEditor.test.tsx index 724462840e7..5ad6019fc2b 100644 --- a/public/app/plugins/datasource/cloudwatch/components/MetricStatEditor/MetricStatEditor.test.tsx +++ b/public/app/plugins/datasource/cloudwatch/components/MetricStatEditor/MetricStatEditor.test.tsx @@ -191,4 +191,14 @@ describe('MetricStatEditor', () => { ]); }); }); + + describe('metric value', () => { + it('should be displayed when a custom value is used and its value is not in the select options', async () => { + const expected = 'CPUUtilzation'; + await act(async () => { + render(); + }); + expect(await screen.findByText(expected)).toBeInTheDocument(); + }); + }); }); diff --git a/public/app/plugins/datasource/cloudwatch/components/MetricStatEditor/MetricStatEditor.tsx b/public/app/plugins/datasource/cloudwatch/components/MetricStatEditor/MetricStatEditor.tsx index c27dd5aab07..899f9ce61c4 100644 --- a/public/app/plugins/datasource/cloudwatch/components/MetricStatEditor/MetricStatEditor.tsx +++ b/public/app/plugins/datasource/cloudwatch/components/MetricStatEditor/MetricStatEditor.tsx @@ -62,7 +62,7 @@ export function MetricStatEditor({ {