catalog-react: use correct waitFor

Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
This commit is contained in:
Vincenzo Scamporlino
2023-10-03 17:13:04 +02:00
parent f858e6ee26
commit 5447358dc9
@@ -16,7 +16,6 @@
import React, { PropsWithChildren } from 'react';
import { CatalogApi } from '@backstage/catalog-client';
import { useAllEntitiesCount } from './useAllEntitiesCount';
import { waitFor } from '@testing-library/react';
import { renderHook } from '@testing-library/react-hooks';
import { EntityListProvider, useEntityList } from '../../hooks';
import { catalogApiRef } from '../../api';
@@ -62,7 +61,7 @@ describe('useAllEntitiesCount', () => {
return <>{props.children}</>;
}
const { result } = renderHook(() => useAllEntitiesCount(), {
const { result, waitFor } = renderHook(() => useAllEntitiesCount(), {
wrapper: ({ children }) => (
<MemoryRouter>
<EntityListProvider>
@@ -90,7 +89,7 @@ describe('useAllEntitiesCount', () => {
pageInfo: {},
});
const { result } = renderHook(() => useAllEntitiesCount(), {
const { result, waitFor } = renderHook(() => useAllEntitiesCount(), {
wrapper: ({ children }) => (
<MemoryRouter>
<EntityListProvider>{children}</EntityListProvider>