message: Add test for user retrieval in details modal
diff: @@ -11,12 +11,17 @@ import { MatDividerModule } from '@angular/material/divider'
  import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'
  import { UserDetailsComponent } from './user-details.component'
  +import { of, throwError } from 'rxjs'
  describe('UserDetailsComponent', () => {
  let component: UserDetailsComponent
  let fixture: ComponentFixture<UserDetailsComponent>
  + let userService: any
  beforeEach(waitForAsync(() => {
  + userService = jasmine.createSpyObj('UserService', ['get'])
  + userService.get.and.returnValue(of({}))
  +
  TestBed.configureTestingModule({
  imports: [
  TranslateModule.forRoot(),
  @@ -26,7 +31,7 @@ describe('UserDetailsComponent', () => {
  ],
  declarations: [UserDetailsComponent],
  providers: [
  - UserService,
  + { provide: UserService, useValue: userService },
  { provide: MatDialogRef, useValue: {} },
  { provide: MAT_DIALOG_DATA, useValue: { dialogData: {} } }
  ]
  @@ -43,4 +48,17 @@ describe('UserDetailsComponent', () => {
  it('should create', () => {
  expect(component).toBeTruthy()
  })
  +
  + it('should log the error on retrieving user', () => {
  + userService.get.and.returnValue(throwError('Error'))
  + console.log = jasmine.createSpy('log')
  + component.ngOnInit()
  + expect(console.log).toHaveBeenCalledWith('Error')
  + })
  +
  + it('should set the retrieved user', () => {
  + userService.get.and.returnValue(of('User'))
  + component.ngOnInit()
  + expect(component.user).toBe('User')
  + })
  })
  