Fix notification event names and allow welcome onboarding
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-02-04 11:22:38 +01:00
parent 049c4f82b9
commit 9ddb135c03
5 changed files with 53 additions and 3 deletions

View File

@@ -12,6 +12,7 @@ describe('resolveOnboardingRedirect', () => {
remainingEvents: null,
pathname: '/event-admin/mobile/dashboard',
isBillingPath: false,
isWelcomePath: false,
isOnboardingDismissed: false,
isOnboardingCompleted: false,
isSuperAdmin: false,
@@ -26,6 +27,7 @@ describe('resolveOnboardingRedirect', () => {
remainingEvents: null,
pathname: ADMIN_BILLING_PATH,
isBillingPath: true,
isWelcomePath: false,
isOnboardingDismissed: false,
isOnboardingCompleted: false,
isSuperAdmin: false,
@@ -40,6 +42,7 @@ describe('resolveOnboardingRedirect', () => {
remainingEvents: 1,
pathname: '/event-admin/mobile/events/new',
isBillingPath: false,
isWelcomePath: false,
isOnboardingDismissed: false,
isOnboardingCompleted: false,
isSuperAdmin: false,
@@ -54,6 +57,7 @@ describe('resolveOnboardingRedirect', () => {
remainingEvents: null,
pathname: '/event-admin/mobile/dashboard',
isBillingPath: false,
isWelcomePath: false,
isOnboardingDismissed: false,
isOnboardingCompleted: false,
isSuperAdmin: false,
@@ -68,6 +72,7 @@ describe('resolveOnboardingRedirect', () => {
remainingEvents: 0,
pathname: '/event-admin/mobile/dashboard',
isBillingPath: false,
isWelcomePath: false,
isOnboardingDismissed: false,
isOnboardingCompleted: false,
isSuperAdmin: false,
@@ -82,6 +87,7 @@ describe('resolveOnboardingRedirect', () => {
remainingEvents: 2,
pathname: '/event-admin/mobile/dashboard',
isBillingPath: false,
isWelcomePath: false,
isOnboardingDismissed: false,
isOnboardingCompleted: false,
isSuperAdmin: false,
@@ -96,6 +102,7 @@ describe('resolveOnboardingRedirect', () => {
remainingEvents: null,
pathname: '/event-admin/mobile/dashboard',
isBillingPath: false,
isWelcomePath: false,
isOnboardingDismissed: false,
isOnboardingCompleted: false,
isSuperAdmin: false,
@@ -110,6 +117,7 @@ describe('resolveOnboardingRedirect', () => {
remainingEvents: null,
pathname: '/event-admin/mobile/dashboard',
isBillingPath: false,
isWelcomePath: false,
isOnboardingDismissed: true,
isOnboardingCompleted: false,
isSuperAdmin: false,
@@ -124,6 +132,7 @@ describe('resolveOnboardingRedirect', () => {
remainingEvents: null,
pathname: '/event-admin/mobile/dashboard',
isBillingPath: false,
isWelcomePath: false,
isOnboardingCompleted: true,
isSuperAdmin: false,
});
@@ -137,10 +146,26 @@ describe('resolveOnboardingRedirect', () => {
remainingEvents: null,
pathname: '/event-admin/mobile/dashboard',
isBillingPath: false,
isWelcomePath: false,
isOnboardingDismissed: false,
isOnboardingCompleted: false,
isSuperAdmin: true,
});
expect(result).toBeNull();
});
it('returns null for welcome paths', () => {
const result = resolveOnboardingRedirect({
hasEvents: false,
hasActivePackage: false,
remainingEvents: null,
pathname: '/event-admin/mobile/welcome',
isBillingPath: false,
isWelcomePath: true,
isOnboardingDismissed: false,
isOnboardingCompleted: false,
isSuperAdmin: false,
});
expect(result).toBeNull();
});
});

View File

@@ -9,6 +9,7 @@ type OnboardingRedirectInput = {
remainingEvents?: number | null;
pathname: string;
isBillingPath: boolean;
isWelcomePath?: boolean;
isOnboardingDismissed?: boolean;
isOnboardingCompleted?: boolean;
isSuperAdmin?: boolean;
@@ -20,6 +21,7 @@ export function resolveOnboardingRedirect({
remainingEvents,
pathname,
isBillingPath,
isWelcomePath,
isOnboardingDismissed,
isOnboardingCompleted,
isSuperAdmin,
@@ -28,6 +30,10 @@ export function resolveOnboardingRedirect({
return null;
}
if (isWelcomePath) {
return null;
}
if (isOnboardingDismissed || isOnboardingCompleted) {
return null;
}