diff --git a/frontend/src/components/Labels/__tests__/LabelCreateDialog.test.tsx b/frontend/src/components/Labels/__tests__/LabelCreateDialog.test.tsx index eefe230..0a17307 100644 --- a/frontend/src/components/Labels/__tests__/LabelCreateDialog.test.tsx +++ b/frontend/src/components/Labels/__tests__/LabelCreateDialog.test.tsx @@ -377,7 +377,10 @@ describe('LabelCreateDialog Component', () => { const createButton = screen.getByText('Create'); await user.click(createButton); - expect(screen.getByText('Saving...')).toBeInTheDocument(); + // Wait for loading state to appear + await waitFor(() => { + expect(screen.getByText('Saving...')).toBeInTheDocument(); + }); expect(createButton).toBeDisabled(); // Wait for submission to complete @@ -396,7 +399,10 @@ describe('LabelCreateDialog Component', () => { const createButton = screen.getByText('Create'); await user.click(createButton); - expect(nameInput).toBeDisabled(); + // Wait for loading state to take effect + await waitFor(() => { + expect(nameInput).toBeDisabled(); + }); expect(screen.getByLabelText(/description/i)).toBeDisabled(); // Wait for submission to complete