message: Test decoding of JWT tokens
diff: @@ -35,6 +35,25 @@ describe('LoginGuard', () => {
  localStorage.removeItem('token')
  expect(guard.canActivate()).toBeFalse()
  }))
  +
  + it('returns payload from decoding a valid JWT', inject([LoginGuard], (guard: LoginGuard) => {
  + localStorage.setItem('token', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c')
  + expect(guard.tokenDecode()).toEqual({
  + sub: '1234567890',
  + name: 'John Doe',
  + iat: 1516239022
  + })
  + }))
  +
  + it('returns nothing when decoding an invalid JWT', inject([LoginGuard], (guard: LoginGuard) => {
  + localStorage.setItem('token', '12345.abcde')
  + expect(guard.tokenDecode()).toBeNull()
  + }))
  +
  + it('returns nothing when decoding an non-existing JWT', inject([LoginGuard], (guard: LoginGuard) => {
  + localStorage.removeItem('token')
  + expect(guard.tokenDecode()).toBeNull()
  + }))
  })
  describe('AdminGuard', () => {
  