Updates
This commit is contained in:
parent
28040f44f4
commit
2394248d53
13 changed files with 571 additions and 538 deletions
|
|
@ -175,20 +175,11 @@ describe('memberProfileUpdateSchema', () => {
|
|||
expect(result.data).not.toHaveProperty('status')
|
||||
})
|
||||
|
||||
it('validates privacy enum values', () => {
|
||||
const result = memberProfileUpdateSchema.safeParse({ bioPrivacy: 'invalid' })
|
||||
expect(result.success).toBe(false)
|
||||
})
|
||||
|
||||
it('accepts valid binary privacy values', () => {
|
||||
expect(memberProfileUpdateSchema.safeParse({ bioPrivacy: 'members' }).success).toBe(true)
|
||||
expect(memberProfileUpdateSchema.safeParse({ bioPrivacy: 'private' }).success).toBe(true)
|
||||
})
|
||||
|
||||
it('coerces legacy "public" privacy value to "members"', () => {
|
||||
const result = memberProfileUpdateSchema.safeParse({ bioPrivacy: 'public' })
|
||||
it('strips unknown privacy fields from profile update', () => {
|
||||
const result = memberProfileUpdateSchema.safeParse({ bioPrivacy: 'members', bio: 'hello' })
|
||||
expect(result.success).toBe(true)
|
||||
expect(result.data.bioPrivacy).toBe('members')
|
||||
expect(result.data).not.toHaveProperty('bioPrivacy')
|
||||
expect(result.data.bio).toBe('hello')
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue