framadate-responsive/mocks/old-stuff/pages/voting/comments-list/comments-list.component.spec.ts

42 lines
1.3 KiB
TypeScript
Raw Normal View History

import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2020-02-05 10:54:30 +01: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-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
});