From f17720803547fbeac1ef195adc1769fcff794a4e Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Fri, 1 Apr 2022 14:26:13 +0200 Subject: [PATCH] chore: waitFor type event Signed-off-by: Johan Haals --- .../components/CatalogGraphPage/MaxDepthFilter.test.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/catalog-graph/src/components/CatalogGraphPage/MaxDepthFilter.test.tsx b/plugins/catalog-graph/src/components/CatalogGraphPage/MaxDepthFilter.test.tsx index d49a4f4a26..bddb2ac8ab 100644 --- a/plugins/catalog-graph/src/components/CatalogGraphPage/MaxDepthFilter.test.tsx +++ b/plugins/catalog-graph/src/components/CatalogGraphPage/MaxDepthFilter.test.tsx @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { render } from '@testing-library/react'; +import { render, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import React from 'react'; import { MaxDepthFilter } from './MaxDepthFilter'; @@ -59,8 +59,7 @@ describe('', () => { expect(onChange).toBeCalledWith(Number.POSITIVE_INFINITY); }); - // TODO: FIX this - test.skip('should select direction', async () => { + test('should select direction', async () => { const onChange = jest.fn(); const { getByLabelText } = render( , @@ -70,6 +69,8 @@ describe('', () => { await userEvent.clear(getByLabelText('maxp')); await userEvent.type(getByLabelText('maxp'), '10'); - expect(onChange).toBeCalledWith(10); + waitFor(() => { + expect(onChange).toBeCalledWith(10); + }); }); });