framadate-responsive/mocks/old-stuff/pages/voting/comments-list/comments-list.component.spec.ts
2021-04-29 10:41:47 +02:00

42 lines
1.3 KiB
TypeScript

import { async, ComponentFixture, TestBed } from '@angular/core/testing';
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';
const routerSpy = jest.fn({ navigateByUrl: jest.fn() });
describe('CommentsListComponent', () => {
let component: CommentsListComponent;
let fixture: ComponentFixture<CommentsListComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [FormsModule, BrowserModule, CommonModule, HttpClientModule],
declarations: [CommentsListComponent],
providers: [
HttpClient,
MessageService,
ConfirmationService,
ConfigService,
{ provide: Router, useValue: routerSpy },
],
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(CommentsListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});