mirror of
https://github.com/langgenius/dify.git
synced 2026-04-29 23:18:05 +08:00
fix: use findByText instead of getByText for async modal appearance in fake timer tests
Co-authored-by: hyoban <38493346+hyoban@users.noreply.github.com>
This commit is contained in:
@ -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')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user