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 12d57c3c452..e2b70b4dbd1 100644
--- a/public/app/plugins/datasource/cloudwatch/components/MetricStatEditor/MetricStatEditor.test.tsx
+++ b/public/app/plugins/datasource/cloudwatch/components/MetricStatEditor/MetricStatEditor.test.tsx
@@ -87,4 +87,16 @@ describe('MetricStatEditor', () => {
expect(screen.queryByText('Match exact')).toBeNull();
});
});
+
+ describe('match exact', () => {
+ it('should be checked when value is true', () => {
+ render();
+ expect(screen.getByLabelText('Match exact - optional')).toBeChecked();
+ });
+
+ it('should be unchecked when value is false', () => {
+ render();
+ expect(screen.getByLabelText('Match exact - optional')).not.toBeChecked();
+ });
+ });
});
diff --git a/public/app/plugins/datasource/cloudwatch/components/MetricStatEditor/MetricStatEditor.tsx b/public/app/plugins/datasource/cloudwatch/components/MetricStatEditor/MetricStatEditor.tsx
index 541c30eee06..67d80da3449 100644
--- a/public/app/plugins/datasource/cloudwatch/components/MetricStatEditor/MetricStatEditor.tsx
+++ b/public/app/plugins/datasource/cloudwatch/components/MetricStatEditor/MetricStatEditor.tsx
@@ -109,7 +109,8 @@ export function MetricStatEditor({
tooltip="Only show metrics that exactly match all defined dimension names."
>
{
onQueryChange({
...query,