From 9c4ed43f041dc69b7bbbb8e8cd517bf992bc808b Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Mon, 4 Apr 2022 11:42:12 +0200 Subject: [PATCH] chore: run setup once Signed-off-by: Johan Haals --- .../src/components/CatalogGraphPage/CatalogGraphPage.test.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/catalog-graph/src/components/CatalogGraphPage/CatalogGraphPage.test.tsx b/plugins/catalog-graph/src/components/CatalogGraphPage/CatalogGraphPage.test.tsx index 700053bcd7..bf25b79b39 100644 --- a/plugins/catalog-graph/src/components/CatalogGraphPage/CatalogGraphPage.test.tsx +++ b/plugins/catalog-graph/src/components/CatalogGraphPage/CatalogGraphPage.test.tsx @@ -30,6 +30,7 @@ import React from 'react'; import { CatalogGraphPage } from './CatalogGraphPage'; const navigate = jest.fn(); +const user = userEvent.setup(); jest.mock('react-router', () => ({ ...jest.requireActual('react-router'), @@ -160,7 +161,6 @@ describe('', () => { expect(await findAllByTestId('node')).toHaveLength(2); await userEvent.click(getByText('b:d/e')); - expect(await findByText('hasPart')).toBeInTheDocument(); }); @@ -173,7 +173,6 @@ describe('', () => { expect(await findAllByTestId('node')).toHaveLength(2); - const user = userEvent.setup(); await user.keyboard('{Shift>}'); await user.click(getByText('b:d/e')); expect(navigate).toBeCalledWith('/entity/{kind}/{namespace}/{name}'); @@ -217,7 +216,6 @@ describe('', () => { expect(await findAllByTestId('node')).toHaveLength(2); - const user = userEvent.setup(); await user.keyboard('{Shift>}'); await user.click(getByText('b:d/e'));