From 7a9f15832065b4c54a71933645f425302fff1722 Mon Sep 17 00:00:00 2001 From: kikootwo Date: Wed, 28 Jan 2026 12:07:00 -0500 Subject: [PATCH] Fix async assertion for error message in test Wraps the assertion for the 'Bad credentials' error message in a waitFor to ensure the element is present after asynchronous updates. --- tests/app/setup/steps/DownloadClientStep.test.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/app/setup/steps/DownloadClientStep.test.tsx b/tests/app/setup/steps/DownloadClientStep.test.tsx index 1829a2e..55bf5b5 100644 --- a/tests/app/setup/steps/DownloadClientStep.test.tsx +++ b/tests/app/setup/steps/DownloadClientStep.test.tsx @@ -122,7 +122,9 @@ describe('DownloadClientStep', () => { expect(fetchMock).toHaveBeenCalledWith('/api/setup/test-download-client', expect.any(Object)); }); - expect(screen.getByText(/Bad credentials/)).toBeInTheDocument(); + await waitFor(() => { + expect(screen.getByText(/Bad credentials/)).toBeInTheDocument(); + }); }); it('disables test connection when SABnzbd fields are incomplete', async () => {