Add birthdate handling in member registration and management. Update UI to conditionally require birthdate for new members, and enhance API to enforce birthdate validation. Improve tests to cover new birthdate requirements.
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 57s
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 57s
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
// @ts-nocheck
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import { createEvent, mockSuccessReadBody } from './setup'
|
||||
|
||||
@@ -150,6 +151,25 @@ describe('Members API Endpoints', () => {
|
||||
const response = await membersPostHandler(event)
|
||||
expect(response.success).toBe(true)
|
||||
})
|
||||
|
||||
it('erlaubt Updates von Altdaten ohne Geburtsdatum', async () => {
|
||||
const event = createEvent({ cookies: { auth_token: 'token' } })
|
||||
mockSuccessReadBody({
|
||||
id: 'legacy-1',
|
||||
firstName: 'Lisa',
|
||||
lastName: 'Beispiel',
|
||||
email: 'lisa@example.com'
|
||||
})
|
||||
authUtils.getUserFromToken.mockResolvedValue({ id: '3', role: 'vorstand' })
|
||||
memberUtils.saveMember.mockResolvedValue(true)
|
||||
|
||||
const response = await membersPostHandler(event)
|
||||
expect(response.success).toBe(true)
|
||||
expect(memberUtils.saveMember).toHaveBeenCalledWith(expect.objectContaining({
|
||||
id: 'legacy-1',
|
||||
geburtsdatum: ''
|
||||
}))
|
||||
})
|
||||
})
|
||||
|
||||
describe('DELETE /api/members', () => {
|
||||
|
||||
Reference in New Issue
Block a user