File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,13 +62,11 @@ const Header = ({
6262 buttonTitle : intl . formatMessage ( messages [ 'header.links.tools' ] ) ,
6363 items : toolsMenuItems ,
6464 } ,
65- ] : [
66- {
67- id : `${ intl . formatMessage ( messages [ 'header.links.tools' ] ) } -dropdown-menu` ,
68- buttonTitle : intl . formatMessage ( messages [ 'header.links.tools' ] ) ,
69- items : libraryToolsMenuItems ,
70- } ,
71- ] ;
65+ ] : [ {
66+ id : `${ intl . formatMessage ( messages [ 'header.links.tools' ] ) } -dropdown-menu` ,
67+ buttonTitle : intl . formatMessage ( messages [ 'header.links.tools' ] ) ,
68+ items : libraryToolsMenuItems ,
69+ } ] ;
7270
7371 // Include settings menu only if user is allowed to see them.
7472 if ( isLibrary && libraryToolsSettingsItems . length > 0 ) {
Original file line number Diff line number Diff line change @@ -145,6 +145,28 @@ describe('header utils', () => {
145145 const items = renderHook ( ( ) => useLibrarySettingsMenuItems ( 'library-123' , false ) ) . result . current ;
146146 expect ( items ) . toContainEqual ( { title : 'Team Access' , href : 'http://localhost/?sa=manage-team' } ) ;
147147 } ) ;
148+ it ( 'should contain admin console url if set' , ( ) => {
149+ setConfig ( {
150+ ...getConfig ( ) ,
151+ ADMIN_CONSOLE_URL : 'http://admin-console.com' ,
152+ } ) ;
153+ const items = renderHook ( ( ) => useLibrarySettingsMenuItems ( 'library-123' , false ) ) . result . current ;
154+ expect ( items ) . toContainEqual ( {
155+ title : 'Team Access' ,
156+ href : 'http://admin-console.com/authz/libraries/library-123' ,
157+ } ) ;
158+ } ) ;
159+ it ( 'should contain admin console url if set and readOnly is true' , ( ) => {
160+ setConfig ( {
161+ ...getConfig ( ) ,
162+ ADMIN_CONSOLE_URL : 'http://admin-console.com' ,
163+ } ) ;
164+ const items = renderHook ( ( ) => useLibrarySettingsMenuItems ( 'library-123' , true ) ) . result . current ;
165+ expect ( items ) . toContainEqual ( {
166+ title : 'Team Access' ,
167+ href : 'http://admin-console.com/authz/libraries/library-123' ,
168+ } ) ;
169+ } ) ;
148170 } ) ;
149171
150172 describe ( 'useLibraryToolsMenuItems' , ( ) => {
You can’t perform that action at this time.
0 commit comments