From c3f363a20362897857a6a073fb900bee3b61d90c Mon Sep 17 00:00:00 2001 From: MahtabBukhari Date: Wed, 13 Nov 2024 12:12:43 +0500 Subject: [PATCH] fix(edges): resolve unit test error --- .../SideBar/FilterSearch/__tests__/index.tsx | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/components/App/SideBar/FilterSearch/__tests__/index.tsx b/src/components/App/SideBar/FilterSearch/__tests__/index.tsx index d6b0046d4..fd39d5664 100644 --- a/src/components/App/SideBar/FilterSearch/__tests__/index.tsx +++ b/src/components/App/SideBar/FilterSearch/__tests__/index.tsx @@ -41,24 +41,25 @@ describe('FilterSearch Component', () => { const mockSetSchemas = jest.fn() const mockSchemaAll = [{ type: 'Type1' }, { type: 'Type2' }, { type: 'Type3' }] + const mockEdges = [{ edge_type: 'Edge1' }, { edge_type: 'Edge2' }, { edge_type: 'Edge3' }] + beforeEach(() => { jest.clearAllMocks() - - // ;(useDataStore as jest.Mock).mockReturnValue({ setFilters: mockSetFilters, fetchData: mockFetchData, setAbortRequests: mockSetAbortRequests, }) - - // - ;(useSchemaStore as jest.Mock).mockReturnValue([mockSchemaAll, mockSetSchemas]) // Return an array - - // + ;(useSchemaStore as jest.Mock).mockReturnValue({ + schemaAll: mockSchemaAll, + schemaLinks: mockEdges, + setSchemas: mockSetSchemas, + }) ;(useFeatureFlagStore as jest.Mock).mockReturnValue({ fastFiltersFeatureFlag: true }) - - // - ;(getSchemaAll as jest.Mock).mockResolvedValue({ schemas: mockSchemaAll }) + ;(getSchemaAll as jest.Mock).mockResolvedValue({ + schemas: mockSchemaAll, + edges: mockEdges, + }) }) const renderComponent = () =>