From 720f03898182d8deb545f624adb6637139e9801a Mon Sep 17 00:00:00 2001 From: Ashley Harrison Date: Fri, 12 Dec 2025 11:24:00 +0000 Subject: [PATCH] "fix" VersionsSettings tests --- .../components/DashboardSettings/VersionsSettings.test.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/app/features/dashboard/components/DashboardSettings/VersionsSettings.test.tsx b/public/app/features/dashboard/components/DashboardSettings/VersionsSettings.test.tsx index b679d1ccf69..663f5fdbf47 100644 --- a/public/app/features/dashboard/components/DashboardSettings/VersionsSettings.test.tsx +++ b/public/app/features/dashboard/components/DashboardSettings/VersionsSettings.test.tsx @@ -1,4 +1,4 @@ -import { screen, waitFor, within } from '@testing-library/react'; +import { act, fireEvent, screen, waitFor, within } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { render } from 'test/test-utils'; @@ -154,7 +154,9 @@ describe('VersionSettings', () => { expect(within(screen.getAllByRole('rowgroup')[1]).getAllByRole('row').length).toBe(VERSIONS_FETCH_LIMIT); const showMoreButton = screen.getByRole('button', { name: /show more versions/i }); - await user.click(showMoreButton); + // TODO investigate why we need act/fireEvent + // see https://github.com/testing-library/react-testing-library/issues/1375 + act(() => fireEvent.click(showMoreButton)); expect(historySrv.getHistoryList).toBeCalledTimes(2); expect(screen.getByText(/Fetching more entries/i)).toBeInTheDocument();