diff --git a/__tests__/Unit/Components/Tasks/TaskDetails.test.tsx b/__tests__/Unit/Components/Tasks/TaskDetails.test.tsx index 6a3cdbdc9..e07cb2888 100644 --- a/__tests__/Unit/Components/Tasks/TaskDetails.test.tsx +++ b/__tests__/Unit/Components/Tasks/TaskDetails.test.tsx @@ -324,8 +324,12 @@ describe('TaskDetails Page', () => { fireEvent.change(textareaElement, { target: { name: 'title', value: 'test 1 for drag and drop' }, }); - const saveButton = await screen.findByRole('button', { name: 'Save' }); - fireEvent.click(saveButton); + await waitFor(async () => { + const saveButton = await screen.findByRole('button', { + name: 'Save', + }); + fireEvent.click(saveButton); + }); expect(screen.queryByText(/Successfully saved/i)).toBeNull(); });