message: Add tests for last login IP
diff: import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'
  import { LastLoginIpComponent } from './last-login-ip.component'
  import { MatCardModule } from '@angular/material/card'
  +import { DomSanitizer } from '@angular/platform-browser'
  describe('LastLoginIpComponent', () => {
  let component: LastLoginIpComponent
  let fixture: ComponentFixture<LastLoginIpComponent>
  + let sanitizer
  beforeEach(waitForAsync(() => {
  + sanitizer = jasmine.createSpyObj('DomSanitizer', ['bypassSecurityTrustHtml', 'sanitize'])
  + sanitizer.bypassSecurityTrustHtml.and.callFake((args: any) => args)
  + sanitizer.sanitize.and.returnValue({})
  +
  TestBed.configureTestingModule({
  declarations: [LastLoginIpComponent],
  + providers: [
  + { provide: DomSanitizer, useValue: sanitizer }
  + ],
  imports: [
  MatCardModule
  ]
  @@ -29,4 +38,23 @@ describe('LastLoginIpComponent', () => {
  it('should compile', () => {
  expect(component).toBeTruthy()
  })
  +
  + it('should log JWT parsing error to console', () => {
  + console.log = jasmine.createSpy('log')
  + localStorage.setItem('token', 'definitelyInvalidJWT')
  + component.ngOnInit()
  + expect(console.log).toHaveBeenCalled()
  + })
  +
  + it('should set Last-Login IP from JWT as trusted HTML', () => {
  + localStorage.setItem('token', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7Imxhc3RMb2dpbklwIjoiMS4yLjMuNCJ9fQ.RAkmdqwNypuOxv3SDjPO4xMKvd1CddKvDFYDBfUt3bg')
  + component.ngOnInit()
  + expect(sanitizer.bypassSecurityTrustHtml).toHaveBeenCalledWith('<small>1.2.3.4</small>')
  + })
  +
  + it('should not set Last-Login IP if none is present in JWT', () => {
  + localStorage.setItem('token', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7fX0.bVBhvll6IaeR3aUdoOeyR8YZe2S2DfhGAxTGfd9enLw')
  + component.ngOnInit()
  + expect(component.lastLoginIp).toBe('?')
  + })
  })
  