message: Added tests for token-sale component
diff: -import { async, ComponentFixture, TestBed } from '@angular/core/testing'
  +import { async, ComponentFixture, TestBed, fakeAsync } from '@angular/core/testing'
  import { TokenSaleComponent } from './token-sale.component'
  +import { of, throwError } from 'rxjs'
  +import { ConfigurationService } from './../Services/configuration.service'
  describe('TokenSaleComponent', () => {
  let component: TokenSaleComponent
  let fixture: ComponentFixture<TokenSaleComponent>
  + let configurationService
  beforeEach(async(() => {
  +
  + configurationService = jasmine.createSpyObj('ConfigurationService', ['getApplicationConfiguration'])
  + configurationService.getApplicationConfiguration.and.returnValue(of({ application: { } }))
  TestBed.configureTestingModule({
  - declarations: [ TokenSaleComponent ]
  + declarations: [ TokenSaleComponent ],
  + providers: [
  + { provide: ConfigurationService, useValue: configurationService }
  + ]
  })
  .compileComponents()
  }))
  @@ -19,7 +28,20 @@ describe('TokenSaleComponent', () => {
  fixture.detectChanges()
  })
  - xit('should create', () => {
  + it('should create', () => {
  expect(component).toBeTruthy()
  })
  +
  + it('should set altcoinName as obtained from configuration', () => {
  + configurationService.getApplicationConfiguration.and.returnValue(of({ application: { altcoinName: 'Coin' } }))
  + component.ngOnInit()
  + expect(component.altcoinName).toBe('Coin')
  + })
  +
  + it('should log error on failure in retrieving configuration from backend', fakeAsync(() => {
  + configurationService.getApplicationConfiguration.and.returnValue(throwError('Error'))
  + console.log = jasmine.createSpy('log')
  + component.ngOnInit()
  + expect(console.log).toHaveBeenCalledWith('Error')
  + }))
  })
  