mirror of
https://github.com/langgenius/dify.git
synced 2026-04-05 18:31:45 +08:00
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:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user