diff --git a/src/components/App/SideBar/__tests__/index.tsx b/src/components/App/SideBar/__tests__/index.tsx index a4ba3b318..ae2c6ff15 100644 --- a/src/components/App/SideBar/__tests__/index.tsx +++ b/src/components/App/SideBar/__tests__/index.tsx @@ -3,8 +3,8 @@ import { ThemeProvider } from '@mui/material' import '@testing-library/jest-dom' import { fireEvent, render, screen, waitFor } from '@testing-library/react' import React from 'react' -import { ThemeProvider as StyleThemeProvider } from 'styled-components' import { MemoryRouter } from 'react-router-dom' +import { ThemeProvider as StyleThemeProvider } from 'styled-components' import { SideBar } from '..' import { api } from '../../../../network/api' import { AppStore, useAppStore } from '../../../../stores/useAppStore' @@ -101,7 +101,9 @@ describe('Test SideBar', () => { , ) - expect(container.querySelector('#sidebar-wrapper')).not.toBeInTheDocument() + waitFor(() => { + expect(container.querySelector('#sidebar-wrapper')).not.toBeInTheDocument() + }) }) it('Verify that the sidebar is visible when sidebarIsOpen is true.', () => { diff --git a/src/components/App/SideBar/index.tsx b/src/components/App/SideBar/index.tsx index 6faa5ecb0..fa207294d 100644 --- a/src/components/App/SideBar/index.tsx +++ b/src/components/App/SideBar/index.tsx @@ -20,7 +20,7 @@ type ContentProp = { // eslint-disable-next-line react/display-name const Content = forwardRef(({ subViewOpen }, ref) => { - const { setSidebarOpen, currentSearch: searchTerm, setSearchFormValue } = useAppStore((s) => s) + const { setSidebarOpen } = useAppStore((s) => s) const hasAiChats = useHasAiChats() @@ -32,7 +32,6 @@ const Content = forwardRef(({ subViewOpen }, ref) = { setSidebarOpen(false) - setSearchFormValue(searchTerm || '') }} > @@ -67,7 +66,7 @@ export const SideBar = () => { return ( <> - +