Changeset View
Changeset View
Standalone View
Standalone View
src/app/notificationArchive/notificationArchive.component.spec.ts
Show All 11 Lines | |||||
import { SuperPost } from '../_models/superPost'; | import { SuperPost } from '../_models/superPost'; | ||||
import { MarkedPipe } from '../_pipes/marked.pipe'; | import { MarkedPipe } from '../_pipes/marked.pipe'; | ||||
import { AreaService } from '../_services/area.service'; | import { AreaService } from '../_services/area.service'; | ||||
import { AuthenticationService } from '../_services/authentication.service'; | import { AuthenticationService } from '../_services/authentication.service'; | ||||
import { NavBarService } from '../_services/navBar.service'; | import { NavBarService } from '../_services/navBar.service'; | ||||
import { NotificationService } from '../_services/notification.service'; | import { NotificationService } from '../_services/notification.service'; | ||||
import { RouteService } from '../_services/route.service'; | import { RouteService } from '../_services/route.service'; | ||||
import { NotificationArchiveComponent } from './notificationArchive.component'; | import { NotificationArchiveComponent } from './notificationArchive.component'; | ||||
import { NgxMasonryModule } from '../_modules/ngx-masonry/ngx-masonry.module'; | |||||
import { NgxPaginationModule } from 'ngx-pagination'; | import { NgxPaginationModule } from 'ngx-pagination'; | ||||
describe('NotificationArchiveComponent', () => { | describe('NotificationArchiveComponent', () => { | ||||
let comp: NotificationArchiveComponent; | let comp: NotificationArchiveComponent; | ||||
let fixture: ComponentFixture<NotificationArchiveComponent>; | let fixture: ComponentFixture<NotificationArchiveComponent>; | ||||
beforeEach(() => { | beforeEach(() => { | ||||
const routerStub = { | const routerStub = { | ||||
Show All 36 Lines | beforeEach(() => { | ||||
{ provide: ActivatedRoute, useValue: activatedRouteStub }, | { provide: ActivatedRoute, useValue: activatedRouteStub }, | ||||
{ provide: AreaService, useValue: areaServiceStub }, | { provide: AreaService, useValue: areaServiceStub }, | ||||
{ 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, MatProgressSpinnerModule, MatSlideToggleModule, FormsModule, NgxMasonryModule, NgxPaginationModule ], | imports: [ MatCardModule, RouterModule, MatTabsModule, MatProgressSpinnerModule, | ||||
MatSlideToggleModule, FormsModule, NgxPaginationModule ], | |||||
}).compileComponents(); | }).compileComponents(); | ||||
fixture = TestBed.createComponent(NotificationArchiveComponent); | fixture = TestBed.createComponent(NotificationArchiveComponent); | ||||
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'); | ||||
}); | }); | ||||
})); | })); | ||||
}); | }); |