aboutsummaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/home/home.component.spec.ts
blob: 9e463e65e0a30f6d8c9313dda9aa63c094d8661b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { TranslateModule, TranslateLoader, TranslateService, TranslateFakeLoader} from '@ngx-translate/core';
import { NgZorroAntdModule } from 'ng-zorro-antd';
import { NgxEchartsModule } from 'ngx-echarts';
import { HttpClientModule } from '@angular/common/http';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { RouterTestingModule } from '@angular/router/testing';

import { HomeComponent } from './home.component';
import { PieComponent } from '../components/charts/pie/pie.component'; 
import { BarComponent } from '../components/charts/bar/bar.component'; 
import { LineComponent } from '../components/charts/line/line.component';
import { HomesService } from '../homes.service';

describe('HomeComponent', () => {
  let component: HomeComponent;
  let fixture: ComponentFixture<HomeComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [ HomeComponent, PieComponent, BarComponent, LineComponent ],
      imports: [TranslateModule.forRoot({loader: { provide: TranslateLoader, useClass: TranslateFakeLoader }}),        
              NgZorroAntdModule, 
              NgxEchartsModule, 
              HttpClientModule,
              BrowserAnimationsModule,
              RouterTestingModule],
      providers: [HomesService, TranslateService]
    })
    .compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(HomeComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should create', () => {
    expect(component).toBeTruthy();
  });
});