Fix the Angular Test Issues
[portal/nonrtric-controlpanel.git] / webapp-frontend / src / app / app.component.spec.ts
1 import { TestBed, async } from '@angular/core/testing';
2 import { APP_BASE_HREF } from '@angular/common';
3 import { RouterModule, Routes } from '@angular/router';
4 import { AppComponent } from './app.component';
5
6 describe('AppComponent', () => {
7   const routes: Routes = [
8     { path: '', redirectTo: '/policy', pathMatch: 'full'}
9   ];
10   beforeEach(async(() => {
11     TestBed.configureTestingModule({
12       declarations: [
13         AppComponent
14       ],
15       imports: [
16         RouterModule.forRoot(routes)
17       ],
18       providers: [
19         { provide: APP_BASE_HREF, useValue: '/' }
20       ]
21     }).compileComponents();
22   }));
23
24   it('should create the app', async(() => {
25     const fixture = TestBed.createComponent(AppComponent);
26     const app = fixture.debugElement.componentInstance;
27     expect(app).toBeTruthy();
28   }));
29
30   it(`should have as title 'controlpanelApp'`, async(() => {
31     const fixture = TestBed.createComponent(AppComponent);
32     const app = fixture.debugElement.componentInstance;
33     expect(app.title).toEqual('controlpanelApp');
34   }));
35 });