Changeset View
Changeset View
Standalone View
Standalone View
src/app/home/home.component.spec.ts
import { By } from '@angular/platform-browser'; | import { By } from '@angular/platform-browser'; | ||||
import { ChangeDetectorRef } from '@angular/core'; | import { ChangeDetectorRef } from '@angular/core'; | ||||
import { ComponentFixture, ComponentFixtureAutoDetect, TestBed, async } from '@angular/core/testing'; | import { ComponentFixture, ComponentFixtureAutoDetect, TestBed, async } from '@angular/core/testing'; | ||||
import { DebugElement } from '@angular/core'; | import { DebugElement } from '@angular/core'; | ||||
import { FormsModule } from '@angular/forms'; | import { FormsModule } from '@angular/forms'; | ||||
import { MatCardModule, MatIconModule, MatListModule, MatMenuModule, MatSlideToggleModule, MatDialogRef, MatDialog, MatProgressSpinnerModule, MatSnackBarModule } from '@angular/material'; | import { MatCardModule, MatIconModule, MatListModule, MatMenuModule, MatSlideToggleModule, MatDialogRef, | ||||
MatDialog, MatProgressSpinnerModule, MatSnackBarModule } from '@angular/material'; | |||||
import { Router, RouterModule } from '@angular/router'; | import { Router, RouterModule } from '@angular/router'; | ||||
import { ActivatedRoute } from '@angular/router'; | import { ActivatedRoute } from '@angular/router'; | ||||
import { Observable } from 'rxjs'; | import { Observable } from 'rxjs'; | ||||
import { Author } from '../_models/author'; | import { Author } from '../_models/author'; | ||||
import { Comment } from '../_models/comment'; | import { Comment } from '../_models/comment'; | ||||
import { Post } from '../_models/post'; | import { Post } from '../_models/post'; | ||||
import { MarkedPipe } from '../_pipes/marked.pipe'; | import { MarkedPipe } from '../_pipes/marked.pipe'; | ||||
import { AreaService } from '../_services/area.service'; | import { AreaService } from '../_services/area.service'; | ||||
▲ Show 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | beforeEach(() => { | ||||
{ provide: MatDialog, useValue: mdDialogStub }, | { provide: MatDialog, useValue: mdDialogStub }, | ||||
{ provide: MatDialogRef, useValue: mdDialogRefStub }, | { provide: MatDialogRef, useValue: mdDialogRefStub }, | ||||
{ provide: NavBarService, useValue: navBarServiceStub }, | { provide: NavBarService, useValue: navBarServiceStub }, | ||||
{ provide: PostService, useValue: postServiceStub }, | { provide: PostService, useValue: postServiceStub }, | ||||
{ provide: ProfileService, useValue: profileServiceStub }, | { provide: ProfileService, useValue: profileServiceStub }, | ||||
{ provide: RouteService, useValue: routeServiceStub }, | { provide: RouteService, useValue: routeServiceStub }, | ||||
{ provide: ComponentFixtureAutoDetect, useValue: true } | { provide: ComponentFixtureAutoDetect, useValue: true } | ||||
], | ], | ||||
imports: [ MatCardModule, MatIconModule, MatListModule, MatMenuModule, FormsModule, ClipboardModule, MatProgressSpinnerModule, MatSlideToggleModule, RouterModule, MatSnackBarModule ] | imports: [ MatCardModule, MatIconModule, MatListModule, MatMenuModule, FormsModule, | ||||
ClipboardModule, MatProgressSpinnerModule, MatSlideToggleModule, RouterModule, MatSnackBarModule ] | |||||
}); | }); | ||||
fixture = TestBed.createComponent(HomeComponent); | fixture = TestBed.createComponent(HomeComponent); | ||||
comp = fixture.componentInstance; | comp = fixture.componentInstance; | ||||
de = fixture.debugElement.query(By.css('.mainText')); | de = fixture.debugElement.query(By.css('.mainText')); | ||||
el = de.nativeElement; | el = de.nativeElement; | ||||
}); | }); | ||||
it('should set post text', async(() => { | it('should set post text', async(() => { | ||||
Show All 18 Lines |