Skip to content

Commit 02b70e6

Browse files
committed
fix(test): add racing condition to wait render before testing
1 parent 799967c commit 02b70e6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/features/transaction-wizard/utils/transactions-url-search-params.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ describe('Render transactions page with search params', () => {
133133
}),
134134
})
135135

136-
expect(await screen.findByText('Offline')).toBeInTheDocument()
136+
expect(await screen.findByText('Offline', {}, { timeout: 3000 })).toBeInTheDocument()
137137
// Find the yellow sender link (auto-populated)
138138
const senderLinks = await screen.findAllByText(localnetDispenderAccount.addr.toString())
139139
expect(senderLinks.some((link) => link.className.includes('text-yellow-500'))).toBe(true)
@@ -226,7 +226,7 @@ describe('Render transactions page with search params', () => {
226226
}),
227227
})
228228

229-
expect(await screen.findByText(receiver)).toBeInTheDocument()
229+
expect(await screen.findByText(receiver, {}, { timeout: 3000 })).toBeInTheDocument()
230230
expect(await screen.findByText('2.5')).toBeInTheDocument()
231231
expect(await screen.findByText(note)).toBeInTheDocument()
232232
expect(await screen.findByText(localnetDispenderAccount.toString())).toBeInTheDocument()
@@ -407,7 +407,7 @@ describe('Render transactions page with search params', () => {
407407
}),
408408
})
409409

410-
expect(await screen.findByText(total)).toBeInTheDocument()
410+
expect(await screen.findByText(total, {}, { timeout: 3000 })).toBeInTheDocument()
411411
expect(await screen.findByText(decimals)).toBeInTheDocument()
412412
expect(await screen.findByText(note)).toBeInTheDocument()
413413
expect(await screen.findByText(localnetDispenderAccount.addr.toString())).toBeInTheDocument()

0 commit comments

Comments
 (0)