diff --git a/frontend/src/app/shared/testData.ts b/frontend/src/app/shared/testData.ts index 9a4a64044e..8760422965 100644 --- a/frontend/src/app/shared/testData.ts +++ b/frontend/src/app/shared/testData.ts @@ -393,6 +393,21 @@ export const testUser: User = { email: 'bob.baumeister@puzzle.ch', }; +export const testOkrChampionUser: User = { + id: 1, + firstname: 'Hans', + lastname: 'Muster', + isOkrChampion: true, + userTeamList: [ + { + id: 1, + team: team1, + isTeamAdmin: false, + }, + ], + email: 'bob.baumeister@puzzle.ch', +}; + export const users: User[] = [ testUser, { diff --git a/frontend/src/app/team-management/member-detail/member-detail.component.spec.ts b/frontend/src/app/team-management/member-detail/member-detail.component.spec.ts index 2523c0a284..3803bc2e23 100644 --- a/frontend/src/app/team-management/member-detail/member-detail.component.spec.ts +++ b/frontend/src/app/team-management/member-detail/member-detail.component.spec.ts @@ -7,7 +7,7 @@ import { TranslateModule } from '@ngx-translate/core'; import { BrowserModule } from '@angular/platform-browser'; import { SharedModule } from '../../shared/shared.module'; import { UserService } from '../../services/user.service'; -import { testUser } from '../../shared/testData'; +import { testOkrChampionUser, testUser } from '../../shared/testData'; import { AddUserTeamComponent } from '../add-user-team/add-user-team.component'; import { MatTableModule } from '@angular/material/table'; import { MatIconModule } from '@angular/material/icon'; @@ -31,6 +31,7 @@ describe('MemberDetailComponent', () => { const userServiceMock = { getUserById: jest.fn(), + getOrInitCurrentUser: jest.fn(), getCurrentUser: jest.fn(), reloadUsers: jest.fn(), reloadCurrentUser: jest.fn(), @@ -79,6 +80,7 @@ describe('MemberDetailComponent', () => { component = fixture.componentInstance; userServiceMock.getUserById.mockReturnValue(of(testUser)); + userServiceMock.getOrInitCurrentUser.mockReturnValue(of(testOkrChampionUser)); userServiceMock.getCurrentUser.mockReturnValue(testUser); userServiceMock.reloadCurrentUser.mockReturnValue(of(testUser));