From 30f2ab07f5609ee21098ca12579eb8ca012d9d97 Mon Sep 17 00:00:00 2001 From: Gilles De Mey Date: Tue, 7 Nov 2023 17:02:32 +0100 Subject: [PATCH] Alerting: Attempt to fix flakey selector (#77780) --- .../features/alerting/unified/RuleEditorCloudRules.test.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/public/app/features/alerting/unified/RuleEditorCloudRules.test.tsx b/public/app/features/alerting/unified/RuleEditorCloudRules.test.tsx index e89c9c033c1..4117406c67d 100644 --- a/public/app/features/alerting/unified/RuleEditorCloudRules.test.tsx +++ b/public/app/features/alerting/unified/RuleEditorCloudRules.test.tsx @@ -3,7 +3,6 @@ import userEvent from '@testing-library/user-event'; import React from 'react'; import { renderRuleEditor, ui } from 'test/helpers/alertingRuleEditor'; import { clickSelectOption } from 'test/helpers/selectOptionInTest'; -import { byRole } from 'testing-library-selector'; import { contextSrv } from 'app/core/services/context_srv'; import { AccessControlAction } from 'app/types'; @@ -141,8 +140,8 @@ describe('RuleEditor cloud', () => { expect(screen.getByTestId('datasource-picker')).toBeInTheDocument(); - const dataSourceSelect = ui.inputs.dataSource.get(); - await user.click(byRole('combobox').get(dataSourceSelect)); + const dataSourceSelect = await ui.inputs.dataSource.find(); + await user.click(dataSourceSelect); await clickSelectOption(dataSourceSelect, 'Prom (default)'); await waitFor(() => expect(mocks.api.fetchRulerRules).toHaveBeenCalled());