@@ -4,9 +4,11 @@ import {
44 organizationCloudSettingsSchema ,
55 organizationFeaturesSchema ,
66 organizationSettingsSchema ,
7+ userSettingsConfigSchema ,
78 type OrganizationCloudSettings ,
89 type OrganizationFeatures ,
910 type OrganizationSettings ,
11+ type UserSettingsConfig ,
1012 type WorkspaceTaskVisibility ,
1113} from "../cloud.js"
1214
@@ -407,3 +409,75 @@ describe("organizationCloudSettingsSchema with llmEnhancedFeaturesEnabled", () =
407409 expect ( result . data ?. cloudSettings ?. llmEnhancedFeaturesEnabled ) . toBe ( false )
408410 } )
409411} )
412+
413+ describe ( "userSettingsConfigSchema with llmEnhancedFeaturesEnabled" , ( ) => {
414+ it ( "should validate without llmEnhancedFeaturesEnabled property" , ( ) => {
415+ const input = {
416+ extensionBridgeEnabled : true ,
417+ taskSyncEnabled : true ,
418+ }
419+ const result = userSettingsConfigSchema . safeParse ( input )
420+ expect ( result . success ) . toBe ( true )
421+ expect ( result . data ?. llmEnhancedFeaturesEnabled ) . toBeUndefined ( )
422+ } )
423+
424+ it ( "should validate with llmEnhancedFeaturesEnabled as true" , ( ) => {
425+ const input = {
426+ extensionBridgeEnabled : true ,
427+ taskSyncEnabled : true ,
428+ llmEnhancedFeaturesEnabled : true ,
429+ }
430+ const result = userSettingsConfigSchema . safeParse ( input )
431+ expect ( result . success ) . toBe ( true )
432+ expect ( result . data ?. llmEnhancedFeaturesEnabled ) . toBe ( true )
433+ } )
434+
435+ it ( "should validate with llmEnhancedFeaturesEnabled as false" , ( ) => {
436+ const input = {
437+ extensionBridgeEnabled : true ,
438+ taskSyncEnabled : true ,
439+ llmEnhancedFeaturesEnabled : false ,
440+ }
441+ const result = userSettingsConfigSchema . safeParse ( input )
442+ expect ( result . success ) . toBe ( true )
443+ expect ( result . data ?. llmEnhancedFeaturesEnabled ) . toBe ( false )
444+ } )
445+
446+ it ( "should reject non-boolean llmEnhancedFeaturesEnabled" , ( ) => {
447+ const input = {
448+ llmEnhancedFeaturesEnabled : "true" ,
449+ }
450+ const result = userSettingsConfigSchema . safeParse ( input )
451+ expect ( result . success ) . toBe ( false )
452+ } )
453+
454+ it ( "should have correct TypeScript type" , ( ) => {
455+ // Type-only test to ensure TypeScript compilation
456+ const settings : UserSettingsConfig = {
457+ extensionBridgeEnabled : true ,
458+ taskSyncEnabled : true ,
459+ llmEnhancedFeaturesEnabled : true ,
460+ }
461+ expect ( settings . llmEnhancedFeaturesEnabled ) . toBe ( true )
462+
463+ const settingsWithoutLlmFeatures : UserSettingsConfig = {
464+ extensionBridgeEnabled : false ,
465+ }
466+ expect ( settingsWithoutLlmFeatures . llmEnhancedFeaturesEnabled ) . toBeUndefined ( )
467+ } )
468+
469+ it ( "should validate empty object" , ( ) => {
470+ const result = userSettingsConfigSchema . safeParse ( { } )
471+ expect ( result . success ) . toBe ( true )
472+ expect ( result . data ) . toEqual ( { } )
473+ } )
474+
475+ it ( "should validate with only llmEnhancedFeaturesEnabled" , ( ) => {
476+ const input = {
477+ llmEnhancedFeaturesEnabled : true ,
478+ }
479+ const result = userSettingsConfigSchema . safeParse ( input )
480+ expect ( result . success ) . toBe ( true )
481+ expect ( result . data ?. llmEnhancedFeaturesEnabled ) . toBe ( true )
482+ } )
483+ } )
0 commit comments