GitLab steht wegen Wartungsarbeiten am Montag, den 10. Mai, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

Add Test for the AdditionalDataComponent

parent bfd8ab93
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AdditionalDataComponent } from './additional-data.component';
import {TrackingMockService} from '../../service/tracking.mock.service';
import {ActiveQuestionGroupMockService} from '../../service/active-question-group.mock.service';
import {TranslateCompiler, TranslateLoader, TranslateModule} from '@ngx-translate/core';
import {HttpClient, HttpClientModule} from '@angular/common/http';
import {createTranslateLoader} from '../../../lib/translation.factory';
import {TranslateMessageFormatCompiler} from 'ngx-translate-messageformat-compiler';
import {RouterTestingModule} from '@angular/router/testing';
import {ActiveQuestionGroupService} from '../../service/active-question-group.service';
import {TrackingService} from '../../service/tracking.service';
describe('AdditionalDataComponent', () => {
let component: AdditionalDataComponent;
......@@ -8,6 +17,25 @@ describe('AdditionalDataComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule,
HttpClientModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: (createTranslateLoader),
deps: [HttpClient]
},
compiler: {
provide: TranslateCompiler,
useClass: TranslateMessageFormatCompiler
}
}),
],
providers: [
{provide: ActiveQuestionGroupService, useClass: ActiveQuestionGroupMockService},
{provide: TrackingService, useClass: TrackingMockService}
],
declarations: [ AdditionalDataComponent ]
})
.compileComponents();
......@@ -22,4 +50,8 @@ describe('AdditionalDataComponent', () => {
it('should create', () => {
expect(component).toBeTruthy();
});
it('should contain a TYPE definition', async(() => {
expect(AdditionalDataComponent.TYPE).toEqual('AdditionalDataComponent');
}));
});
......@@ -25,7 +25,6 @@ export class AdditionalDataComponent implements OnInit {
constructor(
@Inject(DOCUMENT) readonly document,
private translateService: TranslateService,
private activeQuestionGroupService: ActiveQuestionGroupService,
private trackingService: TrackingService,
) {
......
......@@ -16,8 +16,6 @@ import {TrackingService} from '../../service/tracking.service';
import {SharedService} from '../../service/shared.service';
import {ConnectionService} from '../../service/connection.service';
import {CurrentQuizService} from '../../service/current-quiz.service';
import {ArsnovaClickAngulartics2Piwik} from '../../shared/tracking/ArsnovaClickAngulartics2Piwik';
import {Angulartics2Module} from 'angulartics2';
import {WebsocketMockService} from '../../service/websocket.mock.service';
import {CurrentQuizMockService} from '../../service/current-quiz.mock.service';
import {ConnectionMockService} from '../../service/connection.mock.service';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment