2020-04-14 11:28:33 +02:00
|
|
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
2020-02-05 10:54:30 +01:00
|
|
|
|
2020-04-14 11:28:33 +02:00
|
|
|
import { CommentsListComponent } from './comments-list.component';
|
|
|
|
import { FormsModule } from '@angular/forms';
|
|
|
|
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
|
|
|
import { BrowserModule } from '@angular/platform-browser';
|
|
|
|
import { CommonModule } from '@angular/common';
|
|
|
|
import { ConfirmationService, MessageService } from 'primeng';
|
|
|
|
import { Router } from '@angular/router';
|
|
|
|
import { ConfigService } from '../../../services/config.service';
|
2020-02-05 15:21:28 +01:00
|
|
|
|
2020-04-21 10:50:26 +02:00
|
|
|
const routerSpy = jest.fn({ navigateByUrl: jest.fn() });
|
2020-02-05 10:54:30 +01:00
|
|
|
|
|
|
|
describe('CommentsListComponent', () => {
|
2020-04-21 10:50:26 +02:00
|
|
|
let component: CommentsListComponent;
|
|
|
|
let fixture: ComponentFixture<CommentsListComponent>;
|
2020-02-05 10:54:30 +01:00
|
|
|
|
2020-04-21 10:50:26 +02:00
|
|
|
beforeEach(async(() => {
|
|
|
|
TestBed.configureTestingModule({
|
|
|
|
imports: [FormsModule, BrowserModule, CommonModule, HttpClientModule],
|
|
|
|
declarations: [CommentsListComponent],
|
|
|
|
providers: [
|
|
|
|
HttpClient,
|
|
|
|
MessageService,
|
|
|
|
ConfirmationService,
|
|
|
|
ConfigService,
|
|
|
|
{ provide: Router, useValue: routerSpy },
|
|
|
|
],
|
|
|
|
}).compileComponents();
|
|
|
|
}));
|
2020-02-05 10:54:30 +01:00
|
|
|
|
2020-04-21 10:50:26 +02:00
|
|
|
beforeEach(() => {
|
|
|
|
fixture = TestBed.createComponent(CommentsListComponent);
|
|
|
|
component = fixture.componentInstance;
|
|
|
|
fixture.detectChanges();
|
|
|
|
});
|
2020-02-05 10:54:30 +01:00
|
|
|
|
2020-04-21 10:50:26 +02:00
|
|
|
it('should create', () => {
|
|
|
|
expect(component).toBeTruthy();
|
|
|
|
});
|
2020-02-05 10:54:30 +01:00
|
|
|
});
|