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:
copilot-swe-agent[bot]
2026-02-04 15:40:40 +00:00
parent 8c10513d6d
commit 569deaf0a4

View File

@ -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')