@@ -175,6 +175,82 @@ describe("organizationSettingsSchema with features", () => {
175175 } )
176176} )
177177
178+ describe ( "organizationCloudSettingsSchema with allowPublicTaskSharing" , ( ) => {
179+ it ( "should validate without allowPublicTaskSharing property" , ( ) => {
180+ const input = {
181+ recordTaskMessages : true ,
182+ enableTaskSharing : true ,
183+ }
184+ const result = organizationCloudSettingsSchema . safeParse ( input )
185+ expect ( result . success ) . toBe ( true )
186+ expect ( result . data ?. allowPublicTaskSharing ) . toBeUndefined ( )
187+ } )
188+
189+ it ( "should validate with allowPublicTaskSharing as true" , ( ) => {
190+ const input = {
191+ recordTaskMessages : true ,
192+ enableTaskSharing : true ,
193+ allowPublicTaskSharing : true ,
194+ }
195+ const result = organizationCloudSettingsSchema . safeParse ( input )
196+ expect ( result . success ) . toBe ( true )
197+ expect ( result . data ?. allowPublicTaskSharing ) . toBe ( true )
198+ } )
199+
200+ it ( "should validate with allowPublicTaskSharing as false" , ( ) => {
201+ const input = {
202+ recordTaskMessages : true ,
203+ enableTaskSharing : true ,
204+ allowPublicTaskSharing : false ,
205+ }
206+ const result = organizationCloudSettingsSchema . safeParse ( input )
207+ expect ( result . success ) . toBe ( true )
208+ expect ( result . data ?. allowPublicTaskSharing ) . toBe ( false )
209+ } )
210+
211+ it ( "should reject non-boolean allowPublicTaskSharing" , ( ) => {
212+ const input = {
213+ allowPublicTaskSharing : "true" ,
214+ }
215+ const result = organizationCloudSettingsSchema . safeParse ( input )
216+ expect ( result . success ) . toBe ( false )
217+ } )
218+
219+ it ( "should have correct TypeScript type" , ( ) => {
220+ // Type-only test to ensure TypeScript compilation
221+ const settings : OrganizationCloudSettings = {
222+ recordTaskMessages : true ,
223+ enableTaskSharing : true ,
224+ allowPublicTaskSharing : true ,
225+ }
226+ expect ( settings . allowPublicTaskSharing ) . toBe ( true )
227+
228+ const settingsWithoutPublicSharing : OrganizationCloudSettings = {
229+ recordTaskMessages : false ,
230+ }
231+ expect ( settingsWithoutPublicSharing . allowPublicTaskSharing ) . toBeUndefined ( )
232+ } )
233+
234+ it ( "should validate in organizationSettingsSchema with allowPublicTaskSharing" , ( ) => {
235+ const input = {
236+ version : 1 ,
237+ cloudSettings : {
238+ recordTaskMessages : true ,
239+ enableTaskSharing : true ,
240+ allowPublicTaskSharing : false ,
241+ } ,
242+ defaultSettings : { } ,
243+ allowList : {
244+ allowAll : true ,
245+ providers : { } ,
246+ } ,
247+ }
248+ const result = organizationSettingsSchema . safeParse ( input )
249+ expect ( result . success ) . toBe ( true )
250+ expect ( result . data ?. cloudSettings ?. allowPublicTaskSharing ) . toBe ( false )
251+ } )
252+ } )
253+
178254describe ( "organizationCloudSettingsSchema with workspaceTaskVisibility" , ( ) => {
179255 it ( "should validate without workspaceTaskVisibility property" , ( ) => {
180256 const input = {
0 commit comments