diff --git a/public/app/features/alerting/unified/rule-list/FilterView.test.tsx b/public/app/features/alerting/unified/rule-list/FilterView.test.tsx index 01b8e64663c..b436e84941a 100644 --- a/public/app/features/alerting/unified/rule-list/FilterView.test.tsx +++ b/public/app/features/alerting/unified/rule-list/FilterView.test.tsx @@ -34,6 +34,7 @@ beforeEach(() => { const io = mockIntersectionObserver(); describe('RuleList - FilterView', () => { + jest.retryTimes(2); it('should render multiple pages of results', async () => { render(); @@ -53,12 +54,11 @@ describe('RuleList - FilterView', () => { await loadMoreResults(); - const matchingRule = await screen.findByRole('treeitem', { - name: /test-rule-8 test-mimir-namespace test-group-4501/, - }); + const matchingRule = (await screen.findAllByRole('treeitem')).at(0); expect(matchingRule).toBeInTheDocument(); expect(matchingRule).toHaveTextContent('test-rule-8'); + expect(matchingRule).toHaveTextContent('test-mimir-namespace'); expect(matchingRule).toHaveTextContent('test-group-4501'); expect(await screen.findByText(/No more results/)).toBeInTheDocument(); });