| 418 | const fireEvent = rtl.fireEvent; |
| 419 | |
| 420 | function renderGlobalModal(options?: RenderOptions) { |
| 421 | const result = render(<GlobalModal />, options); |
| 422 | |
| 423 | /** |
| 424 | * Helper that waits for the modal to be removed from the DOM. You may need to |
| 425 | * wait for the modal to be removed to avoid any act warnings. |
| 426 | */ |
| 427 | function waitForModalToHide() { |
| 428 | return rtl.waitFor(() => { |
| 429 | expect(rtl.screen.queryByRole('dialog')).not.toBeInTheDocument(); |
| 430 | }); |
| 431 | } |
| 432 | |
| 433 | return {...result, waitForModalToHide}; |
| 434 | } |
| 435 | |
| 436 | /** |
| 437 | * Helper that waits for the drawer to be hidden from the DOM. You may need to |