@@ -722,7 +722,7 @@ describe('CallControl Utils', () => {
722722 it ( 'should update recording state from task data' , ( ) => {
723723 updateCallStateFromTask ( mockCurrentTask as unknown as ITask , mockSetIsRecording ) ;
724724
725- expect ( mockSetIsRecording ) . toHaveBeenCalledWith ( true ) ; // !isPaused = !false = true
725+ expect ( mockSetIsRecording ) . toHaveBeenCalledWith ( true ) ;
726726 } ) ;
727727
728728 it ( 'should handle task with recording paused' , ( ) => {
@@ -733,15 +733,53 @@ describe('CallControl Utils', () => {
733733 interaction : {
734734 ...mockCurrentTask . data . interaction ,
735735 callProcessingDetails : {
736- isPaused : true ,
736+ isPaused : ' true' ,
737737 } ,
738738 } ,
739739 } ,
740740 } ;
741741
742742 updateCallStateFromTask ( taskWithPausedRecording as unknown as ITask , mockSetIsRecording ) ;
743743
744- expect ( mockSetIsRecording ) . toHaveBeenCalledWith ( false ) ; // !isPaused = !true = false
744+ expect ( mockSetIsRecording ) . toHaveBeenCalledWith ( false ) ;
745+ } ) ;
746+
747+ it ( 'should handle isPaused as string "true" from backend' , ( ) => {
748+ const taskWithStringPaused = {
749+ ...mockCurrentTask ,
750+ data : {
751+ ...mockCurrentTask . data ,
752+ interaction : {
753+ ...mockCurrentTask . data . interaction ,
754+ callProcessingDetails : {
755+ isPaused : 'true' ,
756+ } ,
757+ } ,
758+ } ,
759+ } ;
760+
761+ updateCallStateFromTask ( taskWithStringPaused as unknown as ITask , mockSetIsRecording ) ;
762+
763+ expect ( mockSetIsRecording ) . toHaveBeenCalledWith ( false ) ;
764+ } ) ;
765+
766+ it ( 'should handle isPaused as string "false" from backend' , ( ) => {
767+ const taskWithStringNotPaused = {
768+ ...mockCurrentTask ,
769+ data : {
770+ ...mockCurrentTask . data ,
771+ interaction : {
772+ ...mockCurrentTask . data . interaction ,
773+ callProcessingDetails : {
774+ isPaused : 'false' ,
775+ } ,
776+ } ,
777+ } ,
778+ } ;
779+
780+ updateCallStateFromTask ( taskWithStringNotPaused as unknown as ITask , mockSetIsRecording ) ;
781+
782+ expect ( mockSetIsRecording ) . toHaveBeenCalledWith ( true ) ;
745783 } ) ;
746784
747785 it ( 'should return early when currentTask is null' , ( ) => {
0 commit comments