From d3381f4aacb24864653644befd5680ae48e577fe Mon Sep 17 00:00:00 2001 From: Liam Sarsfield <43409125+LiamSarsfield@users.noreply.github.com> Date: Wed, 16 Sep 2026 18:12:14 +0100 Subject: [PATCH] Boost: wait for the Overview header button to re-enable before retrying in the refresh error test The header action is published from an effect, so it re-enables one render after the error notice appears. On a slow CI runner the second click landed while the button was still aria-disabled and was ignored; toBeEnabled() does not check aria-disabled. Co-Authored-By: Claude Opus 5 --- projects/plugins/boost/_inc/overview/overview.test.tsx | 8 +++++++- .../boost/changelog/fix-boost-overview-refresh-test | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 projects/plugins/boost/changelog/fix-boost-overview-refresh-test diff --git a/projects/plugins/boost/_inc/overview/overview.test.tsx b/projects/plugins/boost/_inc/overview/overview.test.tsx index 8ae3ebecbdb6..b5b754c22ddf 100644 --- a/projects/plugins/boost/_inc/overview/overview.test.tsx +++ b/projects/plugins/boost/_inc/overview/overview.test.tsx @@ -448,7 +448,13 @@ test( 'retains loaded scores and Run speed test alongside a subsequent score err 'aria-busy', 'false' ); - expect( screen.getByRole( 'button', { name: 'Run speed test' } ) ).toBeEnabled(); + // The header re-enables in a later render than the notice, and a click on it while aria-disabled is ignored. + await waitFor( () => + expect( screen.getByRole( 'button', { name: 'Run speed test' } ) ).toHaveAttribute( + 'aria-disabled', + 'false' + ) + ); fireEvent.click( screen.getByRole( 'button', { name: 'Run speed test' } ) ); await waitFor( () => expect( screen.queryByText( 'Refresh failed' ) ).not.toBeInTheDocument() ); await expect( screen.findByText( '91' ) ).resolves.toBeTruthy(); diff --git a/projects/plugins/boost/changelog/fix-boost-overview-refresh-test b/projects/plugins/boost/changelog/fix-boost-overview-refresh-test new file mode 100644 index 000000000000..a3865da5a3af --- /dev/null +++ b/projects/plugins/boost/changelog/fix-boost-overview-refresh-test @@ -0,0 +1,4 @@ +Significance: patch +Type: changed +Comment: Fix a timing race in an Overview test. +