File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+ import { render } from '@testing-library/react' ;
3+ import '@testing-library/jest-dom/extend-expect' ;
4+ import MessageList from '../components/MessageList' ;
5+ import { GroupChannelProvider } from '../context' ;
6+ import SendbirdProvider from '../../../lib/Sendbird/context/SendbirdProvider' ;
7+
8+ describe ( 'MessageList Unit Tests' , ( ) => {
9+ const defaultProps = {
10+ channelUrl : 'test-channel' ,
11+ } ;
12+
13+ it ( 'renders MessageList with default value' , ( ) => {
14+ render (
15+ < SendbirdProvider appId = "mockAppId" userId = "mockUserId" >
16+ < GroupChannelProvider { ...defaultProps } >
17+ < MessageList />
18+ </ GroupChannelProvider > ,
19+ </ SendbirdProvider > ,
20+ ) ;
21+ } ) ;
22+ } ) ;
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ const initialState = {
3939 fetchChannelError : null ,
4040 nicknamesMap : new Map ( ) ,
4141
42+ messages : [ ] ,
4243 quoteMessage : null ,
4344 animatedMessageId : null ,
4445 isScrollBottomReached : true ,
You can’t perform that action at this time.
0 commit comments