fix: align dashboard guard with fallback menu access
Build & Deploy / Build & Push Docker Image (push) Successful in 2m46s
Test / Type Check (all packages) (push) Successful in 53s
Build & Deploy / Deploy to VPS (push) Successful in 4s
Test / API Unit Tests (push) Successful in 49s
Test / Homepage Unit Tests (push) Successful in 43s
Test / Storefront Unit Tests (push) Successful in 41s
Test / Admin Unit Tests (push) Successful in 41s
Test / Dashboard Unit Tests (push) Successful in 41s
Test / API Integration Tests (push) Successful in 1m1s

This commit is contained in:
root
2026-07-02 03:18:42 -04:00
parent ea2bd215f6
commit e93b988146
2 changed files with 32 additions and 1 deletions
@@ -66,6 +66,34 @@ describe('DashboardAccessGuard route helpers', () => {
])
})
it('uses baseline routes when the production menu only contains dashboard and billing recovery links', () => {
expect(resolveAllowedRoutes({
subscriptionAccessLevel: 'full',
items: [
{
id: 'dashboard',
itemType: 'INTERNAL_PAGE',
routeOrUrl: '/',
children: [],
},
{
id: 'subscription',
itemType: 'INTERNAL_PAGE',
routeOrUrl: '/subscription',
children: [],
},
],
}, 'OWNER')).toEqual([
'/',
'/reservations',
'/fleet',
'/customers',
'/reports',
'/billing',
'/settings',
])
})
it('does not apply baseline fallback when subscription access is none', () => {
expect(resolveAllowedRoutes({ items: [], subscriptionAccessLevel: 'none' }, 'OWNER')).toEqual([])
})