mirror of https://github.com/langgenius/dify.git
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:
parent
569deaf0a4
commit
dfe24c83ab
|
|
@ -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 () => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue