diff --git a/front/src/components/table/table-header/FilterDropdownButton.tsx b/front/src/components/table/table-header/FilterDropdownButton.tsx index 5fe6480a0..23a0a6808 100644 --- a/front/src/components/table/table-header/FilterDropdownButton.tsx +++ b/front/src/components/table/table-header/FilterDropdownButton.tsx @@ -65,7 +65,11 @@ export function FilterDropdownButton({ selectedFilter: FilterType, ) => { if (filterSearchResults.loading) { - return 'LOADING'; + return ( + + Loading + + ); } return filterSearchResults.results.map((value, index) => ( { it('Calls the filters when typing a new name', async () => { const setFilters = jest.fn(); - const { getByText, getByPlaceholderText, queryByText } = render( + const { getByText, getByPlaceholderText, queryByText, getByTestId } = render( , ); @@ -100,7 +100,7 @@ it('Calls the filters when typing a new name', async () => { fireEvent.change(filterSearch, { target: { value: 'Jane' } }); await waitFor(() => { - const loadingDiv = getByText('LOADING'); + const loadingDiv = getByTestId('loading-search-results'); expect(loadingDiv).toBeDefined(); }); diff --git a/front/src/services/search/search.ts b/front/src/services/search/search.ts index 9353efbb9..bf0f7e18c 100644 --- a/front/src/services/search/search.ts +++ b/front/src/services/search/search.ts @@ -72,6 +72,7 @@ export const useSearch = (): [ { variables: { where, + limit: 5, }, skip: !filter, },