diff --git a/__tests__/components/shared/sprint-switcher.test.tsx b/__tests__/components/shared/sprint-switcher.test.tsx index a9639fd..ecbc6af 100644 --- a/__tests__/components/shared/sprint-switcher.test.tsx +++ b/__tests__/components/shared/sprint-switcher.test.tsx @@ -16,6 +16,7 @@ vi.mock('next/navigation', () => ({ vi.mock('@/actions/active-sprint', () => ({ setActiveSprintAction: vi.fn(), switchActiveSprintAction: vi.fn(), + clearActiveSprintAction: vi.fn(), })) vi.mock('sonner', () => ({ @@ -23,25 +24,9 @@ vi.mock('sonner', () => ({ })) const isDemoMock = { value: false } -// Mock-state shape moet alle paden dekken die SprintSwitcher selecteert: -// - s.context.isDemo (oude code) -// - s.entities.settings.workflow?.pendingSprintDraft?.[productId]?.goal (PBI-79) -type MockStoreState = { - context: { isDemo: boolean } - entities: { - settings: { - workflow?: { - pendingSprintDraft?: Record - } - } - } -} vi.mock('@/stores/user-settings/store', () => ({ - useUserSettingsStore: (selector: (s: MockStoreState) => unknown) => - selector({ - context: { isDemo: isDemoMock.value }, - entities: { settings: {} }, - }), + useUserSettingsStore: (selector: (s: { context: { isDemo: boolean }; entities: { settings: { workflow: null } } }) => unknown) => + selector({ context: { isDemo: isDemoMock.value }, entities: { settings: { workflow: null } } }), })) vi.mock('@/components/ui/dropdown-menu', () => { diff --git a/components/ideas/idea-detail-layout.tsx b/components/ideas/idea-detail-layout.tsx index 0a86514..2f333d4 100644 --- a/components/ideas/idea-detail-layout.tsx +++ b/components/ideas/idea-detail-layout.tsx @@ -16,6 +16,7 @@ import { toast } from 'sonner' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' import { Textarea } from '@/components/ui/textarea' +import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover' import { getIdeaStatusBadge } from '@/lib/idea-status-colors' import type { IdeaStatusApi } from '@/lib/idea-status' import { isIdeaEditable } from '@/lib/idea-status' @@ -363,25 +364,43 @@ function IdeaFormSection({ idea, products, isDemo, pending, secondaryProducts }: {products.filter((p) => p.id !== productId).length > 0 && (
-
- {products - .filter((p) => p.id !== productId) - .map((p) => ( - - ))} -
+ + + {selectedSecondary.length > 0 + ? `Extra producten (${selectedSecondary.length})` + : 'Extra producten'} + + } + /> + + {products + .filter((p) => p.id !== productId) + .map((p) => ( + + ))} + +
)}