@@ -357,6 +357,7 @@ describe('ChannelService', () => {
357357 service . usersTypingInChannel$ . subscribe ( typingUsersSpy ) ;
358358 const typingUsersInThreadSpy = jasmine . createSpy ( ) ;
359359 service . usersTypingInThread$ . subscribe ( typingUsersInThreadSpy ) ;
360+ service . isMessageLoadingInProgress = true ;
360361 messagesSpy . calls . reset ( ) ;
361362 activeChannelSpy . calls . reset ( ) ;
362363 messageToQuoteSpy . calls . reset ( ) ;
@@ -386,6 +387,7 @@ describe('ChannelService', () => {
386387 ( activeChannel as MockChannel ) . handleEvent ( 'message.new' , mockMessage ( ) ) ;
387388
388389 expect ( messagesSpy ) . not . toHaveBeenCalled ( ) ;
390+ expect ( service . isMessageLoadingInProgress ) . toBeFalse ( ) ;
389391 } ) ;
390392
391393 it ( 'should tell if user #hasMoreChannels$' , async ( ) => {
@@ -2177,7 +2179,11 @@ describe('ChannelService', () => {
21772179 service . activeChannelMessages$ . subscribe ( messagesSpy ) ;
21782180 messagesSpy . calls . reset ( ) ;
21792181 const messageId = '1232121123' ;
2180- await service . jumpToMessage ( messageId ) ;
2182+ const response = service . jumpToMessage ( messageId ) ;
2183+
2184+ expect ( service . isMessageLoadingInProgress ) . toBeTrue ( ) ;
2185+
2186+ await response ;
21812187
21822188 expect ( jumpToMessageIdSpy ) . toHaveBeenCalledWith ( {
21832189 id : messageId ,
@@ -2187,6 +2193,7 @@ describe('ChannelService', () => {
21872193 expect ( messagesSpy ) . toHaveBeenCalledWith (
21882194 jasmine . arrayContaining ( [ jasmine . objectContaining ( { id : messageId } ) ] )
21892195 ) ;
2196+ expect ( service . isMessageLoadingInProgress ) . toBeFalse ( ) ;
21902197 } ) ;
21912198
21922199 it ( `should display error notification if message couldn't be loaded` , async ( ) => {
@@ -2211,6 +2218,7 @@ describe('ChannelService', () => {
22112218 expect ( notificationService . addTemporaryNotification ) . toHaveBeenCalledWith (
22122219 'streamChat.Message not found'
22132220 ) ;
2221+ expect ( service . isMessageLoadingInProgress ) . toBeFalse ( ) ;
22142222 } ) ;
22152223
22162224 it ( 'should pin message' , async ( ) => {
0 commit comments