@@ -89,8 +89,8 @@ describe('setupStreamingClient', () => {
8989
9090describe ( 'handleConversationUpdate' , ( ) => {
9191 it ( 'should call sessionManager.handleConversationUpdate with the transformed event' , ( ) => {
92- mockSdk . sessionManager = { handleConversationUpdate : jest . fn ( ) } as any ;
93-
92+ mockSdk . sessionManager = { handleConversationUpdateRaw : jest . fn ( ) , handleConversationUpdate : jest . fn ( ) } as any ;
93+
9494 const userId = '444kjskdk' ;
9595 const participant1 = {
9696 id : '7b809e10-fb79-4420-9d5f-69d232ddf490' ,
@@ -146,6 +146,65 @@ describe('handleConversationUpdate', () => {
146146 } ) ;
147147} ) ;
148148
149+ describe ( 'handleConversationUpdateRaw' , ( ) => {
150+ it ( 'should call sessionManager.handleConversationUpdateRaw with the event' , ( ) => {
151+ mockSdk . sessionManager = { handleConversationUpdateRaw : jest . fn ( ) , handleConversationUpdate : jest . fn ( ) } as any ;
152+
153+ const userId = '444kjskdk' ;
154+ const participant1 = {
155+ id : '7b809e10-fb79-4420-9d5f-69d232ddf490' ,
156+ userId : 'dad93e0d-31fa-4fd2-8fc4-d9d3f214ddcf' ,
157+ purpose : 'user' ,
158+ videos : [
159+ {
160+ state : CommunicationStates . connected ,
161+ id : '5e2bf9b8-c9d5-4975-b89b-756b6bd0b3d5' ,
162+ context : '5d1130ff978496186c5ce304@conference.test-valve-1ym37mj1kao.orgspan.com' ,
163+ audioMuted : false ,
164+ videoMuted : true ,
165+ sharingScreen : false ,
166+ peerCount : 0
167+ }
168+ ]
169+ } ;
170+
171+ const local = {
172+ id : '7sdffs-4420-9d5f-69d232ddf490' ,
173+ userId,
174+ purpose : 'user' ,
175+ videos : [
176+ {
177+ state : CommunicationStates . connected ,
178+ id : '5e2bf9b855125-b89b-756b6bd0b3d5' ,
179+ context : '5d1130ff978496186c5ce304@conference.test-valve-1ym37mj1kao.orgspan.com' ,
180+ audioMuted : false ,
181+ videoMuted : true ,
182+ sharingScreen : false ,
183+ peerCount : 0
184+ }
185+ ]
186+ } ;
187+
188+ const event : SubscriptionEvent = {
189+ eventBody : {
190+ id : 'ff5a3ba2-373b-42c7-912a-5309a2656095' ,
191+ participants : [ participant1 , local ]
192+ } ,
193+ metadata : {
194+ correlationId : '11l2k31j'
195+ } ,
196+ topicName : `v2.users.${ userId } .coversations`
197+ } ;
198+
199+ handleConversationUpdate . call ( mockSdk , event ) ;
200+
201+ const spy = mockSdk . sessionManager . handleConversationUpdateRaw ;
202+ expect ( spy ) . toHaveBeenCalled ( ) ;
203+ const arg = ( spy as jest . Mock ) . mock . calls [ 0 ] [ 0 ] ;
204+ expect ( arg ) . toEqual ( event ) ;
205+ } ) ;
206+ } ) ;
207+
149208describe ( 'handleDisconnectedEvent' , ( ) => {
150209 it ( 'should emit disconnected event with message and eventData' , ( ) => {
151210 const eventData = { reconnecting : true } ;
0 commit comments