Changeset View
Changeset View
Standalone View
Standalone View
src/app/notification/notification.component.spec.ts
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | beforeEach(() => { | ||||
{ provide: Router, useValue: routerStub }, | { provide: Router, useValue: routerStub }, | ||||
{ provide: ActivatedRoute, useValue: activatedRouteStub }, | { provide: ActivatedRoute, useValue: activatedRouteStub }, | ||||
{ provide: AuthenticationService, useValue: authenticationServiceStub }, | { provide: AuthenticationService, useValue: authenticationServiceStub }, | ||||
{ provide: NavBarService, useValue: navBarServiceStub }, | { provide: NavBarService, useValue: navBarServiceStub }, | ||||
{ provide: NotificationService, useValue: notificationServiceStub }, | { provide: NotificationService, useValue: notificationServiceStub }, | ||||
{ provide: RouteService, useValue: routeServiceStub }, | { provide: RouteService, useValue: routeServiceStub }, | ||||
{ provide: ComponentFixtureAutoDetect, useValue: true } | { provide: ComponentFixtureAutoDetect, useValue: true } | ||||
], | ], | ||||
imports: [ MatCardModule, RouterModule, MatTabsModule, NgxPaginationModule, MatDialogModule, MatProgressSpinnerModule, MatSnackBarModule ], | imports: [ MatCardModule, RouterModule, MatTabsModule, NgxPaginationModule, MatDialogModule, | ||||
MatProgressSpinnerModule, MatSnackBarModule ], | |||||
}).compileComponents(); | }).compileComponents(); | ||||
fixture = TestBed.createComponent(NotificationComponent); | fixture = TestBed.createComponent(NotificationComponent); | ||||
comp = fixture.componentInstance; | comp = fixture.componentInstance; | ||||
}); | }); | ||||
it('should set notification text', async(() => { | it('should set notification text', async(() => { | ||||
fixture.detectChanges(); | fixture.detectChanges(); | ||||
fixture.whenStable().then(() => { | fixture.whenStable().then(() => { | ||||
fixture.detectChanges(); | fixture.detectChanges(); | ||||
expect(fixture.debugElement.query(By.css('.notifications')).nativeElement.textContent).toBe('test'); | expect(fixture.debugElement.query(By.css('.notifications')).nativeElement.textContent).toBe('test'); | ||||
}); | }); | ||||
})); | })); | ||||
}); | }); |