From 44b1b0dbd978821dccc504f7d50a3c09b78970f2 Mon Sep 17 00:00:00 2001 From: ARREY-ETTA BESSONG EKEP OBASI Date: Sat, 20 Apr 2024 01:18:36 +0100 Subject: [PATCH] fix: failing tests --- .../SettingsView/GraphBlueprint/__tests__/index.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/SettingsModal/SettingsView/GraphBlueprint/__tests__/index.tsx b/src/components/SettingsModal/SettingsView/GraphBlueprint/__tests__/index.tsx index 2026b5361f..009c80a7ec 100644 --- a/src/components/SettingsModal/SettingsView/GraphBlueprint/__tests__/index.tsx +++ b/src/components/SettingsModal/SettingsView/GraphBlueprint/__tests__/index.tsx @@ -1,6 +1,6 @@ -import React from 'react' -import { render, screen } from '@testing-library/react' import '@testing-library/jest-dom' +import { render, screen, waitFor } from '@testing-library/react' +import React from 'react' import { GraphBlueprint } from '../index' jest.mock('../../../../../network/fetchSourcesData', () => ({ @@ -15,8 +15,10 @@ describe('GraphBlueprint', () => { it('should display only one Custom node', async () => { render() - const customNodes = await screen.findAllByText('Custom') + await waitFor(async () => { + const customNodes = await screen.findAllByText('Custom') - expect(customNodes).toHaveLength(1) + expect(customNodes).toHaveLength(1) + }) }) })