feat(sprint-dialogs): conform aan dialog-pattern + entity-profile
Story 5 van PBI "Alle dialogen conform docs/patterns/dialog.md". - lib/schemas/sprint.ts — gedeelde zod-schemas (create/dates/goal) - actions/sprints.ts — code+fieldErrors voor 422; code: 403 voor auth/demo errors - StartSprintButton dialog: useDirtyCloseGuard, useDialogSubmitShortcut, entityDialog* layout-classes; DemoTooltip op trigger; veld-niveau errors via fieldErrors - SprintHeader's date- en complete-dialogen: zelfde behandeling; date- dialog krijgt dirty-guard, complete-dialog krijgt DemoTooltip op bevestigen - docs/specs/dialogs/sprint.md — entity-profile dat alle drie de modes documenteert; consolidatie naar één SprintDialog component bewust uitgesteld - Sprint-dates tests aangepast aan nieuwe action-shape Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
01e77fc560
commit
784791d8f9
7 changed files with 320 additions and 125 deletions
|
|
@ -53,10 +53,9 @@ describe('createSprintAction — date validation', () => {
|
|||
|
||||
it('rejects end_date before start_date', async () => {
|
||||
const fd = makeFormData({ productId: 'product-1', sprint_goal: 'Doel', start_date: '2026-05-14', end_date: '2026-05-01' })
|
||||
const result = await createSprintAction(undefined, fd)
|
||||
expect(result.error).toBeTruthy()
|
||||
const errors = result.error as Record<string, string[]>
|
||||
expect(errors.end_date?.[0]).toContain('Einddatum')
|
||||
const result = await createSprintAction(undefined, fd) as { code?: number; fieldErrors?: Record<string, string[]> }
|
||||
expect(result.code).toBe(422)
|
||||
expect(result.fieldErrors?.end_date?.[0]).toContain('Einddatum')
|
||||
})
|
||||
|
||||
it('accepts no dates (both optional)', async () => {
|
||||
|
|
@ -81,10 +80,9 @@ describe('updateSprintDatesAction — date validation', () => {
|
|||
|
||||
it('rejects end_date before start_date', async () => {
|
||||
const fd = makeFormData({ id: 'sprint-1', start_date: '2026-05-10', end_date: '2026-05-05' })
|
||||
const result = await updateSprintDatesAction(undefined, fd)
|
||||
expect(result.error).toBeTruthy()
|
||||
const errors = result.error as Record<string, string[]>
|
||||
expect(errors.end_date?.[0]).toContain('Einddatum')
|
||||
const result = await updateSprintDatesAction(undefined, fd) as { code?: number; fieldErrors?: Record<string, string[]> }
|
||||
expect(result.code).toBe(422)
|
||||
expect(result.fieldErrors?.end_date?.[0]).toContain('Einddatum')
|
||||
})
|
||||
|
||||
it('blocks demo users', async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue