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 = {
39
39
fetchChannelError : null ,
40
40
nicknamesMap : new Map ( ) ,
41
41
42
+ messages : [ ] ,
42
43
quoteMessage : null ,
43
44
animatedMessageId : null ,
44
45
isScrollBottomReached : true ,
You can’t perform that action at this time.
0 commit comments