|
1 | 1 | import { createMemoryRouter, RouterProvider } from 'react-router-dom' |
2 | 2 | import { afterEach, beforeEach, describe, expect, it, vitest } from 'vitest' |
3 | 3 | import { TransactionWizardPage } from '../transaction-wizard-page' |
4 | | -import { render, screen, cleanup, waitFor } from '@testing-library/react' |
| 4 | +import { render, screen, cleanup } from '@testing-library/react' |
5 | 5 | import { algorandFixture } from '@algorandfoundation/algokit-utils/testing' |
6 | 6 | import { TooltipProvider } from '@/features/common/components/tooltip' |
7 | 7 | import { ToastContainer } from 'react-toastify' |
@@ -133,9 +133,7 @@ describe('Render transactions page with search params', () => { |
133 | 133 | }), |
134 | 134 | }) |
135 | 135 |
|
136 | | - const senderElements = await screen.findAllByText(localnetDispenserAccount.addr.toString(), {}, { timeout: 10_000 }) |
137 | | - |
138 | | - expect(senderElements.length).toBeGreaterThanOrEqual(1) |
| 136 | + expect(await screen.findByText(localnetDispenserAccount.addr.toString(), {}, { timeout: 10_000 })).toBeInTheDocument() |
139 | 137 | }) |
140 | 138 | }) |
141 | 139 |
|
@@ -224,9 +222,7 @@ describe('Render transactions page with search params', () => { |
224 | 222 | }), |
225 | 223 | }) |
226 | 224 |
|
227 | | - const senderElements = await screen.findAllByText(localnetDispenserAccount.addr.toString(), {}, { timeout: 10_000 }) |
228 | | - |
229 | | - expect(senderElements.length).toBeGreaterThanOrEqual(1) |
| 225 | + expect(await screen.findByText(localnetDispenserAccount.addr.toString(), {}, { timeout: 10_000 })).toBeInTheDocument() |
230 | 226 | }) |
231 | 227 |
|
232 | 228 | it.each([ |
@@ -402,9 +398,7 @@ describe('Render transactions page with search params', () => { |
402 | 398 | }), |
403 | 399 | }) |
404 | 400 |
|
405 | | - const senderElements = await screen.findAllByText(localnetDispenserAccount.addr.toString(), {}, { timeout: 10_000 }) |
406 | | - |
407 | | - expect(senderElements.length).toBeGreaterThanOrEqual(1) |
| 401 | + expect(await screen.findByText(localnetDispenserAccount.addr.toString(), {}, { timeout: 10_000 })).toBeInTheDocument() |
408 | 402 | }) |
409 | 403 |
|
410 | 404 | it.each([ |
@@ -1026,9 +1020,7 @@ describe('Render transactions page with search params', () => { |
1026 | 1020 | }), |
1027 | 1021 | }) |
1028 | 1022 |
|
1029 | | - const senderElements = await screen.findAllByText(localnetDispenserAccount.addr.toString(), {}, { timeout: 10_000 }) |
1030 | | - |
1031 | | - expect(senderElements.length).toBeGreaterThanOrEqual(1) |
| 1023 | + expect(await screen.findByText(localnetDispenserAccount.addr.toString(), {}, { timeout: 10_000 })).toBeInTheDocument() |
1032 | 1024 | }) |
1033 | 1025 |
|
1034 | 1026 | it.each([ |
@@ -1467,13 +1459,8 @@ describe('Render transactions page with search params', () => { |
1467 | 1459 | }), |
1468 | 1460 | }) |
1469 | 1461 |
|
1470 | | - await waitFor( |
1471 | | - () => { |
1472 | | - expect(screen.getByText(assetId)).toBeInTheDocument() |
1473 | | - expect(screen.getByText(localnetDispenserAccount.addr.toString())).toBeInTheDocument() |
1474 | | - }, |
1475 | | - { timeout: 10_000 } |
1476 | | - ) |
| 1462 | + expect(await screen.findByText(assetId)).toBeInTheDocument() |
| 1463 | + expect(await screen.findByText(localnetDispenserAccount.addr.toString(), {}, { timeout: 10_000 })).toBeInTheDocument() |
1477 | 1464 | }) |
1478 | 1465 |
|
1479 | 1466 | it.each([ |
|
0 commit comments