diff --git a/web/app/components/rag-pipeline/components/update-dsl-modal.spec.tsx b/web/app/components/rag-pipeline/components/update-dsl-modal.spec.tsx index cbc38ed268..3d2d05ce8f 100644 --- a/web/app/components/rag-pipeline/components/update-dsl-modal.spec.tsx +++ b/web/app/components/rag-pipeline/components/update-dsl-modal.spec.tsx @@ -726,8 +726,8 @@ describe('UpdateDSLModal', () => { vi.useRealTimers() - // Element should be immediately available after advancing timers and flushing - expect(screen.getByText('newApp.appCreateDSLErrorTitle')).toBeInTheDocument() + // Wait for element to appear after advancing timers and flushing + await screen.findByText('newApp.appCreateDSLErrorTitle') }) it('should show version info in error modal', async () => { @@ -859,8 +859,8 @@ describe('UpdateDSLModal', () => { vi.useRealTimers() - // Element should be immediately available after advancing timers and flushing - expect(screen.getByText('newApp.appCreateDSLErrorTitle')).toBeInTheDocument() + // Wait for element to appear after advancing timers and flushing + await screen.findByText('newApp.appCreateDSLErrorTitle') // Click confirm button const confirmButton = screen.getByText('newApp.Confirm') @@ -1161,8 +1161,8 @@ describe('UpdateDSLModal', () => { vi.useRealTimers() - // Element should be immediately available after advancing timers and flushing - expect(screen.getByText('newApp.appCreateDSLErrorTitle')).toBeInTheDocument() + // Wait for element to appear after advancing timers and flushing + await screen.findByText('newApp.appCreateDSLErrorTitle') const confirmButton = screen.getByText('newApp.Confirm')