Add tasks setup nudge and prompt
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-16 14:41:09 +01:00
parent 9a4ece33bf
commit 1517eb8631
6 changed files with 230 additions and 4 deletions

View File

@@ -149,7 +149,12 @@ vi.mock('../components/Primitives', () => ({
<span>{value}</span>
</div>
),
ActionTile: ({ label }: { label: string }) => <div>{label}</div>,
ActionTile: ({ label, note }: { label: string; note?: string }) => (
<div>
<span>{label}</span>
{note ? <span>{note}</span> : null}
</div>
),
PillBadge: ({ children }: { children: React.ReactNode }) => <div>{children}</div>,
SkeletonCard: () => <div>Loading...</div>,
}));
@@ -242,7 +247,25 @@ describe('MobileDashboardPage', () => {
fixtures.activePackage.package_type = 'reseller';
fixtures.activePackage.remaining_events = 3;
fixtures.event.tasks_count = 4;
fixtures.event.engagement_mode = undefined;
navigateMock.mockClear();
window.sessionStorage.clear();
});
it('shows a tasks setup nudge and prompt when no tasks are assigned', () => {
fixtures.event.tasks_count = 0;
fixtures.event.engagement_mode = 'tasks';
window.sessionStorage.setItem(`tasksDecisionPrompt:${fixtures.event.id}`, 'pending');
render(<MobileDashboardPage />);
expect(screen.getByText('Setup needed')).toBeInTheDocument();
expect(
screen.getByText(
'Your event is live with tasks enabled, but no tasks are assigned yet. Choose to add tasks now or disable tasks for this event.'
)
).toBeInTheDocument();
});
it('does not redirect endcustomer packages without remaining event quota', () => {