Skip to content

Commit 0b0d1b8

Browse files
fix: hooks tests fixed
1 parent 822dd39 commit 0b0d1b8

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/header/hooks.test.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,21 @@ describe('header utils', () => {
225225
});
226226

227227
describe('useLibrarySettingsMenuItems', () => {
228+
let originalConfig: any;
229+
230+
beforeEach(() => {
231+
originalConfig = { ...getConfig() };
232+
});
233+
234+
afterEach(() => {
235+
setConfig(originalConfig);
236+
});
237+
228238
it('should contain team access url', () => {
239+
const configWithoutAdminConsole = { ...getConfig() };
240+
delete configWithoutAdminConsole.ADMIN_CONSOLE_URL;
241+
setConfig(configWithoutAdminConsole);
242+
229243
const items = renderHook(() => useLibrarySettingsMenuItems('library-123', false), { wrapper: createWrapper() }).result.current;
230244
expect(items).toContainEqual({ title: 'Library Team', href: 'http://localhost/?sa=manage-team' });
231245
});

0 commit comments

Comments
 (0)