Skip to content

Commit 2243e86

Browse files
committed
test: add tests
1 parent 7a516d6 commit 2243e86

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

src/header/hooks.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff 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', () => {

0 commit comments

Comments
 (0)