File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
src/components/ChannelList/__tests__ Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -304,6 +304,23 @@ describe('ChannelList', () => {
304304 expect ( results ) . toHaveNoViolations ( ) ;
305305 } ) ;
306306
307+ it ( 'renders Search component if searchController state indicates active search' , async ( ) => {
308+ const searchController = new SearchController ( ) ;
309+ const searchTestId = 'search-test-id' ;
310+ const Search = ( ) => < div data-testid = { searchTestId } /> ;
311+ const client = await getTestClientWithUser ( { id : 'userId' } ) ;
312+
313+ render (
314+ < Chat client = { client } Search = { Search } searchController = { searchController } >
315+ < ChannelList showChannelSearch />
316+ </ Chat > ,
317+ ) ;
318+ await act ( ( ) => {
319+ searchController . activate ( ) ;
320+ } ) ;
321+ expect ( screen . getByTestId ( searchTestId ) ) . toBeInTheDocument ( ) ;
322+ } ) ;
323+
307324 it ( 'should render `LoadingErrorIndicator` when queryChannels api throws error' , async ( ) => {
308325 useMockedApis ( chatClient , [ erroredPostApi ( ) ] ) ;
309326 jest . spyOn ( console , 'warn' ) . mockImplementationOnce ( ( ) => null ) ;
You can’t perform that action at this time.
0 commit comments