diff --git a/website/src/components/SearchPage/SearchFullUI.spec.tsx b/website/src/components/SearchPage/SearchFullUI.spec.tsx index d4721e59d2..f7bdbf2b22 100644 --- a/website/src/components/SearchPage/SearchFullUI.spec.tsx +++ b/website/src/components/SearchPage/SearchFullUI.spec.tsx @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/explicit-member-accessibility */ /* eslint-disable @typescript-eslint/no-empty-function */ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; -import { render, screen, waitFor } from '@testing-library/react'; +import { render, screen, waitFor, waitForElementToBeRemoved } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { beforeEach, describe, expect, it, vi } from 'vitest'; @@ -225,6 +225,7 @@ describe('SearchFullUI', () => { await userEvent.click(field1Checkbox); const closeButton = await screen.findByRole('button', { name: 'Close' }); await userEvent.click(closeButton); + await waitForElementToBeRemoved(() => screen.queryByText('Toggle the visibility of search fields')); expect(screen.queryByLabelText('Field 1')).not.toBeInTheDocument(); });