|
|
@@ -175,6 +175,82 @@ describe("organizationSettingsSchema with features", () => {
|
|
|
})
|
|
|
})
|
|
|
|
|
|
+describe("organizationCloudSettingsSchema with allowPublicTaskSharing", () => {
|
|
|
+ it("should validate without allowPublicTaskSharing property", () => {
|
|
|
+ const input = {
|
|
|
+ recordTaskMessages: true,
|
|
|
+ enableTaskSharing: true,
|
|
|
+ }
|
|
|
+ const result = organizationCloudSettingsSchema.safeParse(input)
|
|
|
+ expect(result.success).toBe(true)
|
|
|
+ expect(result.data?.allowPublicTaskSharing).toBeUndefined()
|
|
|
+ })
|
|
|
+
|
|
|
+ it("should validate with allowPublicTaskSharing as true", () => {
|
|
|
+ const input = {
|
|
|
+ recordTaskMessages: true,
|
|
|
+ enableTaskSharing: true,
|
|
|
+ allowPublicTaskSharing: true,
|
|
|
+ }
|
|
|
+ const result = organizationCloudSettingsSchema.safeParse(input)
|
|
|
+ expect(result.success).toBe(true)
|
|
|
+ expect(result.data?.allowPublicTaskSharing).toBe(true)
|
|
|
+ })
|
|
|
+
|
|
|
+ it("should validate with allowPublicTaskSharing as false", () => {
|
|
|
+ const input = {
|
|
|
+ recordTaskMessages: true,
|
|
|
+ enableTaskSharing: true,
|
|
|
+ allowPublicTaskSharing: false,
|
|
|
+ }
|
|
|
+ const result = organizationCloudSettingsSchema.safeParse(input)
|
|
|
+ expect(result.success).toBe(true)
|
|
|
+ expect(result.data?.allowPublicTaskSharing).toBe(false)
|
|
|
+ })
|
|
|
+
|
|
|
+ it("should reject non-boolean allowPublicTaskSharing", () => {
|
|
|
+ const input = {
|
|
|
+ allowPublicTaskSharing: "true",
|
|
|
+ }
|
|
|
+ const result = organizationCloudSettingsSchema.safeParse(input)
|
|
|
+ expect(result.success).toBe(false)
|
|
|
+ })
|
|
|
+
|
|
|
+ it("should have correct TypeScript type", () => {
|
|
|
+ // Type-only test to ensure TypeScript compilation
|
|
|
+ const settings: OrganizationCloudSettings = {
|
|
|
+ recordTaskMessages: true,
|
|
|
+ enableTaskSharing: true,
|
|
|
+ allowPublicTaskSharing: true,
|
|
|
+ }
|
|
|
+ expect(settings.allowPublicTaskSharing).toBe(true)
|
|
|
+
|
|
|
+ const settingsWithoutPublicSharing: OrganizationCloudSettings = {
|
|
|
+ recordTaskMessages: false,
|
|
|
+ }
|
|
|
+ expect(settingsWithoutPublicSharing.allowPublicTaskSharing).toBeUndefined()
|
|
|
+ })
|
|
|
+
|
|
|
+ it("should validate in organizationSettingsSchema with allowPublicTaskSharing", () => {
|
|
|
+ const input = {
|
|
|
+ version: 1,
|
|
|
+ cloudSettings: {
|
|
|
+ recordTaskMessages: true,
|
|
|
+ enableTaskSharing: true,
|
|
|
+ allowPublicTaskSharing: false,
|
|
|
+ },
|
|
|
+ defaultSettings: {},
|
|
|
+ allowList: {
|
|
|
+ allowAll: true,
|
|
|
+ providers: {},
|
|
|
+ },
|
|
|
+ }
|
|
|
+ const result = organizationSettingsSchema.safeParse(input)
|
|
|
+ expect(result.success).toBe(true)
|
|
|
+ expect(result.data?.cloudSettings?.allowPublicTaskSharing).toBe(false)
|
|
|
+ })
|
|
|
+})
|
|
|
+
|
|
|
describe("organizationCloudSettingsSchema with workspaceTaskVisibility", () => {
|
|
|
it("should validate without workspaceTaskVisibility property", () => {
|
|
|
const input = {
|