From 569deaf0a4bf58d1f8d25a9604683b1677762d23 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Feb 2026 15:40:40 +0000 Subject: [PATCH] fix: use findByText instead of getByText for async modal appearance in fake timer tests Co-authored-by: hyoban <38493346+hyoban@users.noreply.github.com> --- .../components/update-dsl-modal.spec.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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')