File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -1687,9 +1687,13 @@ describe('Channel search', async () => {
16871687} ) ;
16881688
16891689describe ( 'Channel lastMessage' , async ( ) => {
1690- const client = await getClientWithUser ( ) ;
1691- const channel = client . channel ( 'messaging' , uuidv4 ( ) ) ;
1692- client . _addChannelConfig ( { cid : channel . cid , config : { } } ) ;
1690+ let channel ;
1691+ let client ;
1692+ beforeEach ( async ( ) => {
1693+ client = await getClientWithUser ( ) ;
1694+ channel = client . channel ( 'messaging' , uuidv4 ( ) ) ;
1695+ client . _addChannelConfig ( { cid : channel . cid , config : { } } ) ;
1696+ } ) ;
16931697
16941698 it ( 'should return last message - messages are in order' , ( ) => {
16951699 channel . state = new ChannelState ( channel ) ;
@@ -1758,9 +1762,6 @@ describe('Channel lastMessage', async () => {
17581762 channel . state . addMessagesSorted ( latestMessages ) ;
17591763 channel . state . addMessagesSorted ( otherMessages , 'new' ) ;
17601764
1761- expect ( channel . lastMessage ( ) . created_at . getTime ( ) ) . to . be . equal (
1762- new Date ( latestMessageDate ) . getTime ( ) ,
1763- ) ;
17641765 expect ( channel . state . last_message_at . getTime ( ) ) . toBe (
17651766 new Date ( latestMessages [ 1 ] . created_at ) . getTime ( ) ,
17661767 ) ;
You can’t perform that action at this time.
0 commit comments