fix: use synchronous getByText assertion while in fake timer mode before restoring real timers

Co-authored-by: hyoban <38493346+hyoban@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-02-04 16:47:38 +00:00
parent 569deaf0a4
commit dfe24c83ab
1 changed files with 9 additions and 9 deletions

View File

@ -724,10 +724,10 @@ describe('UpdateDSLModal', () => {
await Promise.resolve()
})
// Element should be visible immediately after advancing timers
expect(screen.getByText('newApp.appCreateDSLErrorTitle')).toBeInTheDocument()
vi.useRealTimers()
// Wait for element to appear after advancing timers and flushing
await screen.findByText('newApp.appCreateDSLErrorTitle')
})
it('should show version info in error modal', async () => {
@ -857,11 +857,11 @@ describe('UpdateDSLModal', () => {
await Promise.resolve()
})
// Element should be visible immediately after advancing timers
expect(screen.getByText('newApp.appCreateDSLErrorTitle')).toBeInTheDocument()
vi.useRealTimers()
// Wait for element to appear after advancing timers and flushing
await screen.findByText('newApp.appCreateDSLErrorTitle')
// Click confirm button
const confirmButton = screen.getByText('newApp.Confirm')
@ -1159,11 +1159,11 @@ describe('UpdateDSLModal', () => {
await Promise.resolve()
})
// Element should be visible immediately after advancing timers
expect(screen.getByText('newApp.appCreateDSLErrorTitle')).toBeInTheDocument()
vi.useRealTimers()
// Wait for element to appear after advancing timers and flushing
await screen.findByText('newApp.appCreateDSLErrorTitle')
const confirmButton = screen.getByText('newApp.Confirm')
await act(async () => {