diff --git a/.betterer.results b/.betterer.results
index 4146be12bc7..d9734967ab5 100644
--- a/.betterer.results
+++ b/.betterer.results
@@ -158,9 +158,6 @@ exports[`no enzyme tests`] = {
"public/app/features/users/UsersListPage.test.tsx:2518052139": [
[0, 19, 13, "RegExp match", "2409514259"]
],
- "public/app/plugins/datasource/cloud-monitoring/components/Aggregation.test.tsx:3822406835": [
- [1, 19, 13, "RegExp match", "2409514259"]
- ],
"public/app/plugins/datasource/cloudwatch/components/ConfigEditor.test.tsx:227258837": [
[0, 19, 13, "RegExp match", "2409514259"]
],
diff --git a/public/app/plugins/datasource/cloud-monitoring/components/Aggregation.test.tsx b/public/app/plugins/datasource/cloud-monitoring/components/Aggregation.test.tsx
index 02fd2285a08..10a8ca40bca 100644
--- a/public/app/plugins/datasource/cloud-monitoring/components/Aggregation.test.tsx
+++ b/public/app/plugins/datasource/cloud-monitoring/components/Aggregation.test.tsx
@@ -1,10 +1,8 @@
import { render, screen } from '@testing-library/react';
-import { shallow } from 'enzyme';
import React from 'react';
+import { openMenu } from 'react-select-event';
import { TemplateSrvStub } from 'test/specs/helpers';
-import { Select } from '@grafana/ui';
-
import { ValueTypes, MetricKind } from '../types';
import { Aggregation, Props } from './Aggregation';
@@ -39,14 +37,11 @@ describe('Aggregation', () => {
};
it('should not have the reduce values', () => {
- const wrapper = shallow();
- const { options } = wrapper.find(Select).props() as any;
- const [, aggGroup] = options;
-
- expect(aggGroup.options.length).toEqual(11);
- expect(aggGroup.options.map((o: any) => o.value)).toEqual(
- expect.not.arrayContaining(['REDUCE_COUNT_TRUE', 'REDUCE_COUNT_FALSE'])
- );
+ render();
+ const label = screen.getByLabelText('Group by function');
+ openMenu(label);
+ expect(screen.queryByText('count true')).not.toBeInTheDocument();
+ expect(screen.queryByText('count false')).not.toBeInTheDocument();
});
});
@@ -60,12 +55,10 @@ describe('Aggregation', () => {
};
it('should have the reduce values', () => {
- const wrapper = shallow();
- const { options } = wrapper.find(Select).props() as any;
- const [, aggGroup] = options;
-
- expect(aggGroup.options.length).toEqual(11);
- expect(aggGroup.options.map((o: any) => o.value)).toEqual(expect.arrayContaining(['REDUCE_NONE']));
+ render();
+ const label = screen.getByLabelText('Group by function');
+ openMenu(label);
+ expect(screen.getByText('none')).toBeInTheDocument();
});
});
});