File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -511,4 +511,27 @@ describe('sidebar menu', () => {
511511 expect ( screen . getByRole ( 'link' , { name : / m e m o r y / i } ) ) . toBeVisible ( ) ;
512512 expect ( screen . getByRole ( 'link' , { name : / s o u l s / i } ) ) . toBeVisible ( ) ;
513513 } ) ;
514+
515+ it ( 'does not append Pro labels to unavailable sidebar features' , ( ) => {
516+ useHasFeatureMock . mockReturnValue ( false ) ;
517+
518+ renderMenu ( ) ;
519+
520+ fireEvent . click (
521+ screen . getByRole ( 'button' , { name : 'Toggle Monitor section' } )
522+ ) ;
523+ expect ( screen . getByRole ( 'link' , { name : 'Audit Logs' } ) ) . toBeVisible ( ) ;
524+ expect (
525+ screen . queryByRole ( 'link' , { name : 'Audit Logs (Pro)' } )
526+ ) . not . toBeInTheDocument ( ) ;
527+
528+ fireEvent . click (
529+ screen . getByRole ( 'button' , { name : 'Toggle Administration section' } )
530+ ) ;
531+ fireEvent . click ( screen . getByRole ( 'button' , { name : 'Access section' } ) ) ;
532+ expect ( screen . getByRole ( 'link' , { name : 'Users' } ) ) . toBeVisible ( ) ;
533+ expect (
534+ screen . queryByRole ( 'link' , { name : 'Users (Pro)' } )
535+ ) . not . toBeInTheDocument ( ) ;
536+ } ) ;
514537} ) ;
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ import {
1616 useIsAdmin ,
1717} from '@/contexts/AuthContext' ;
1818import { useConfig } from '@/contexts/ConfigContext' ;
19- import { useHasFeature } from '@/hooks/useLicense' ;
2019import { cn } from '@/lib/utils' ;
2120import { getResponsiveTitleClass } from '@/lib/text-utils' ;
2221import { roleAtLeast } from '@/lib/workspaceAccess' ;
@@ -462,8 +461,6 @@ export const mainListItems = React.forwardRef<
462461 const config = useConfig ( ) ;
463462 const isAdmin = useIsAdmin ( ) ;
464463 const { user } = useAuth ( ) ;
465- const hasRbac = useHasFeature ( 'rbac' ) ;
466- const hasAudit = useHasFeature ( 'audit' ) ;
467464 const canWrite =
468465 config . authMode !== 'builtin'
469466 ? config . permissions . writeDags
@@ -732,7 +729,7 @@ export const mainListItems = React.forwardRef<
732729 { canViewAuditLogs && (
733730 < NavItem
734731 to = "/audit-logs"
735- text = { hasAudit ? ' Audit Logs' : 'Audit Logs (Pro)' }
732+ text = " Audit Logs"
736733 isOpen = { isOpen }
737734 onClick = { onNavItemClick }
738735 customColor = { customColor }
@@ -879,7 +876,7 @@ export const mainListItems = React.forwardRef<
879876 >
880877 < NavItem
881878 to = "/users"
882- text = { hasRbac ? ' Users' : 'Users (Pro)' }
879+ text = " Users"
883880 isOpen = { isOpen }
884881 onClick = { onNavItemClick }
885882 customColor = { customColor }
You can’t perform that action at this time.
0 commit comments