Skip to content

Commit

Permalink
Fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Oct 26, 2021
1 parent d94dd60 commit 9a23a7f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ui/src/app/core/components/Header.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,21 @@ jest.mock('../../i18n/hooks', () => ({
const mockIsAdmin = jest.fn();
const mockCurrentUser = jest.fn();
const mockCurrentUserLoading = jest.fn();
const mockUseUserGroupNames = jest.fn();

jest.mock('../user/UserContext', () => ({
useIsAdmin: () => mockIsAdmin(),
useCurrentUser: () => mockCurrentUser(),
useCurrentUserLoading: () => mockCurrentUserLoading()
useCurrentUserLoading: () => mockCurrentUserLoading(),
useUserGroupNames: () => mockUseUserGroupNames()
}));

describe('header for admins', () => {
beforeEach(() => {
mockIsAdmin.mockReturnValue(true);
mockCurrentUser.mockReturnValue({ username: 'foo', groupId: 'bar' });
mockCurrentUserLoading.mockReturnValue(false);
mockUseUserGroupNames.mockReturnValue('Foo');
});

it('should display logo and navigation', () => {
Expand Down

0 comments on commit 9a23a7f

Please sign in to comment.