message: Test retrieval of application version
diff: @@ -21,6 +21,7 @@ import { MatButtonModule } from '@angular/material/button'
  import { MatMenuModule } from '@angular/material/menu'
  import { MatListModule } from '@angular/material/list'
  import { roles } from '../roles'
  +import { AdministrationService } from '../Services/administration.service'
  class MockSocket {
  on (str: string, callback: Function) {
  @@ -34,6 +35,7 @@ describe('SidenavComponent', () => {
  let challengeService: any
  let cookieService: any
  let configurationService: any
  + let administractionService: any
  let mockSocket: any
  let socketIoService: any
  let loginGuard
  @@ -43,6 +45,8 @@ describe('SidenavComponent', () => {
  configurationService.getApplicationConfiguration.and.returnValue(of({ application: { welcomeBanner: {} }, hackingInstructor: {} }))
  challengeService = jasmine.createSpyObj('ChallengeService', ['find'])
  challengeService.find.and.returnValue(of([{ solved: false }]))
  + administractionService = jasmine.createSpyObj('AdministrationService', ['getApplicationVersion'])
  + administractionService.getApplicationVersion.and.returnValue(of(null))
  cookieService = jasmine.createSpyObj('CookieService', ['delete', 'get', 'set'])
  mockSocket = new MockSocket()
  socketIoService = jasmine.createSpyObj('SocketIoService', ['socket'])
  @@ -66,6 +70,7 @@ describe('SidenavComponent', () => {
  providers: [
  { provide: ConfigurationService, useValue: configurationService },
  { provide: ChallengeService, useValue: challengeService },
  + { provide: AdministrationService, useValue: administractionService },
  { provide: CookieService, useValue: cookieService },
  { provide: SocketIoService, useValue: socketIoService },
  { provide: LoginGuard, useValue: loginGuard },
  @@ -92,9 +97,16 @@ describe('SidenavComponent', () => {
  expect(component.isAccounting()).toBe(true)
  })
  + it('should set version number as retrieved with "v" prefix', () => {
  + loginGuard.tokenDecode.and.returnValue({ data: { role: roles.accounting } })
  +
  + expect(component.isAccounting()).toBe(true)
  + })
  +
  it('should not show accounting functionality when user lacks according role', () => {
  - loginGuard.tokenDecode.and.returnValue({ data: { role: roles.customer } })
  + administractionService.getApplicationVersion.and.returnValue(of('1.2.3'))
  + component.ngOnInit()
  - expect(component.isAccounting()).toBe(false)
  + expect(component.version).toBe('v1.2.3')
  })
  })
  