File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -18,9 +18,10 @@ describe('addParticipant util', () => {
1818
1919
2020 it ( 'it adds participant to conversation' , async ( ) => {
21+ let createSpy = jest . fn ( ( options ) => { return mockParticipant } )
2122
22- let createSpy = jest . fn ( ( options ) => { return options } ) ;
23- let participantsSpy = jest . fn ( ( ) => { return { create : createSpy } } ) ;
23+ let participantsSpy = { participants : { create : createSpy } } ;
24+
2425 const conversationsSpy = jest . fn ( ( options ) => { return participantsSpy } ) ;
2526
2627 mockedClient [ 'conversations' ] = {
@@ -30,10 +31,8 @@ describe('addParticipant util', () => {
3031
3132 const result = await addParticipant ( "myConversationSid" , mockParticipant ) ;
3233 expect ( conversationsSpy ) . toBeCalledWith ( "myConversationSid" ) ;
33- expect ( participantsSpy ) . toBeCalled ( ) ;
3434 expect ( createSpy ) . toBeCalledWith ( mockParticipant ) ;
3535 expect ( result ) . not . toBeNull ( ) ;
36-
3736 } )
3837
3938
You can’t perform that action at this time.
0 commit comments