@@ -52,6 +52,7 @@ describe("cortiClient.stream.connect", () => {
5252 id : interactionId ,
5353 awaitConfiguration : false ,
5454 configuration : {
55+ xCortiRetentionPolicy : "retain" ,
5556 transcription : {
5657 primaryLanguage : "en" ,
5758 isDiarization : true ,
@@ -95,6 +96,7 @@ describe("cortiClient.stream.connect", () => {
9596 streamSocket . sendConfiguration ( {
9697 type : "config" ,
9798 configuration : {
99+ xCortiRetentionPolicy : "retain" ,
98100 transcription : {
99101 primaryLanguage : "en" ,
100102 isDiarization : true ,
@@ -125,6 +127,74 @@ describe("cortiClient.stream.connect", () => {
125127 } ) ;
126128 } ) ;
127129
130+ describe ( "should connect with all xCortiRetentionPolicy enum values" , ( ) => {
131+ it ( "should connect with xCortiRetentionPolicy retain without errors or warnings" , async ( ) => {
132+ expect . assertions ( 2 ) ;
133+
134+ const interactionId = await createTestInteraction ( cortiClient , createdInteractionIds ) ;
135+
136+ const streamSocket = await cortiClient . stream . connect ( {
137+ id : interactionId ,
138+ awaitConfiguration : false ,
139+ configuration : {
140+ xCortiRetentionPolicy : "retain" ,
141+ transcription : {
142+ primaryLanguage : "en" ,
143+ participants : [
144+ {
145+ channel : 0 ,
146+ role : "doctor" ,
147+ } ,
148+ ] ,
149+ } ,
150+ mode : {
151+ type : "facts" ,
152+ outputLocale : "en-US" ,
153+ } ,
154+ } ,
155+ } ) ;
156+ activeSockets . push ( streamSocket ) ;
157+
158+ await waitForWebSocketMessage ( streamSocket , "CONFIG_ACCEPTED" , { rejectOnWrongMessage : true } ) ;
159+
160+ expect ( streamSocket . socket . readyState ) . toBe ( 1 ) ; // OPEN
161+ expect ( consoleWarnSpy ) . not . toHaveBeenCalled ( ) ;
162+ } ) ;
163+
164+ it ( "should connect with xCortiRetentionPolicy none without errors or warnings" , async ( ) => {
165+ expect . assertions ( 2 ) ;
166+
167+ const interactionId = await createTestInteraction ( cortiClient , createdInteractionIds ) ;
168+
169+ const streamSocket = await cortiClient . stream . connect ( {
170+ id : interactionId ,
171+ awaitConfiguration : false ,
172+ configuration : {
173+ xCortiRetentionPolicy : "none" ,
174+ transcription : {
175+ primaryLanguage : "en" ,
176+ participants : [
177+ {
178+ channel : 0 ,
179+ role : "doctor" ,
180+ } ,
181+ ] ,
182+ } ,
183+ mode : {
184+ type : "facts" ,
185+ outputLocale : "en-US" ,
186+ } ,
187+ } ,
188+ } ) ;
189+ activeSockets . push ( streamSocket ) ;
190+
191+ await waitForWebSocketMessage ( streamSocket , "CONFIG_ACCEPTED" , { rejectOnWrongMessage : true } ) ;
192+
193+ expect ( streamSocket . socket . readyState ) . toBe ( 1 ) ; // OPEN
194+ expect ( consoleWarnSpy ) . not . toHaveBeenCalled ( ) ;
195+ } ) ;
196+ } ) ;
197+
128198 describe ( "should connect with different participant roles" , ( ) => {
129199 it ( "should connect with doctor role" , async ( ) => {
130200 expect . assertions ( 2 ) ;
0 commit comments