Add more unit tests

parent 4c7b2621
...@@ -1229,7 +1229,7 @@ ...@@ -1229,7 +1229,7 @@
"dev": true "dev": true
}, },
"arsnova-click-v2-types": { "arsnova-click-v2-types": {
"version": "git+https://git.thm.de/arsnova/arsnova-click-v2-types.git#5d88ec8b9494541e3644f534cb839e1047167857", "version": "git+https://git.thm.de/arsnova/arsnova-click-v2-types.git#88ca43a877a3243c7945396d07fca67b659aa9ab",
"from": "git+https://git.thm.de/arsnova/arsnova-click-v2-types.git", "from": "git+https://git.thm.de/arsnova/arsnova-click-v2-types.git",
"dev": true "dev": true
}, },
......
import { HttpClient, HttpClientModule } from '@angular/common/http'; import { HttpClient, HttpClientModule } from '@angular/common/http';
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { TranslateCompiler, TranslateLoader, TranslateModule } from '@ngx-translate/core'; import { TranslateCompiler, TranslateLoader, TranslateModule } from '@ngx-translate/core';
...@@ -19,7 +19,7 @@ describe('MemberGroupManagerComponent', () => { ...@@ -19,7 +19,7 @@ describe('MemberGroupManagerComponent', () => {
let component: MemberGroupManagerComponent; let component: MemberGroupManagerComponent;
let fixture: ComponentFixture<MemberGroupManagerComponent>; let fixture: ComponentFixture<MemberGroupManagerComponent>;
beforeEach(async(() => { beforeEach((() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
imports: [ imports: [
RouterTestingModule, RouterTestingModule,
...@@ -48,13 +48,54 @@ describe('MemberGroupManagerComponent', () => { ...@@ -48,13 +48,54 @@ describe('MemberGroupManagerComponent', () => {
}).compileComponents(); }).compileComponents();
})); }));
beforeEach(async(() => { beforeEach((() => {
fixture = TestBed.createComponent(MemberGroupManagerComponent); fixture = TestBed.createComponent(MemberGroupManagerComponent);
component = fixture.componentInstance; component = fixture.componentInstance;
fixture.detectChanges(); fixture.detectChanges();
})); }));
it('should create', async(() => { beforeEach(() => {
component.memberGroups.splice(0, component.memberGroups.length);
component.memberGroups.push('Default');
});
it('should create', (() => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
})); }));
it('should contain a TYPE reference', (() => {
expect(MemberGroupManagerComponent.TYPE).toEqual('MemberGroupManagerComponent');
}));
describe('#addMemberGroup', () => {
it('should add a member group on valid input', (() => {
component.memberGroupName = 'testgroup';
component.addMemberGroup();
expect(component.memberGroups.length).toEqual(2);
}));
it('should not add a member group on invalid input', (() => {
component.memberGroupName = '';
component.addMemberGroup();
expect(component.memberGroups.length).toEqual(1);
}));
it('should not add an existing member group', (() => {
component.memberGroupName = 'testgroup';
component.addMemberGroup();
component.addMemberGroup();
expect(component.memberGroups.length).toEqual(2);
}));
});
describe('#removeMemberGroup', () => {
it('should remove an existing member group', (() => {
component.removeMemberGroup('Default');
expect(component.memberGroups.length).toEqual(0);
}));
it('should not remove a not existing member group', (() => {
component.removeMemberGroup('notexisting');
expect(component.memberGroups.length).toEqual(1);
}));
});
}); });
...@@ -61,7 +61,7 @@ export class MemberGroupManagerComponent implements OnDestroy { ...@@ -61,7 +61,7 @@ export class MemberGroupManagerComponent implements OnDestroy {
} }
public addMemberGroup(): void { public addMemberGroup(): void {
if (this.memberGroups.indexOf(this.memberGroupName) > -1 || !this.memberGroupName.length) { if (!this.memberGroupName.length || this.memberGroups.find(group => group === this.memberGroupName)) {
return; return;
} }
...@@ -70,7 +70,11 @@ export class MemberGroupManagerComponent implements OnDestroy { ...@@ -70,7 +70,11 @@ export class MemberGroupManagerComponent implements OnDestroy {
} }
public removeMemberGroup(groupName: string): void { public removeMemberGroup(groupName: string): void {
this.memberGroups.splice(this.memberGroups.indexOf(groupName), 1); if (!this.memberGroups.find(group => group === groupName)) {
return;
}
this.memberGroups.splice(this.memberGroups.findIndex(group => group === groupName), 1);
} }
} }
import { HttpClient, HttpHeaders } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { Component, OnDestroy, OnInit } from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
import { IAvailableNicks } from 'arsnova-click-v2-types/src/common'; import { IAvailableNicks } from 'arsnova-click-v2-types/src/common';
...@@ -23,7 +23,9 @@ export class NicknameManagerComponent implements OnInit, OnDestroy { ...@@ -23,7 +23,9 @@ export class NicknameManagerComponent implements OnInit, OnDestroy {
set availableNicks(value: IAvailableNicks) { set availableNicks(value: IAvailableNicks) {
this._availableNicks = value; this._availableNicks = value;
this._availableNicks.emojis = this._availableNicks.emojis.map(nick => this.sanitizeHTML(parseGithubFlavoredMarkdown(nick))); if (this._availableNicks.emojis) {
this._availableNicks.emojis = this._availableNicks.emojis.map(nick => this.sanitizeHTML(parseGithubFlavoredMarkdown(nick)));
}
this._availableNicksBackup = Object.assign({}, value); this._availableNicksBackup = Object.assign({}, value);
} }
...@@ -52,7 +54,7 @@ export class NicknameManagerComponent implements OnInit, OnDestroy { ...@@ -52,7 +54,7 @@ export class NicknameManagerComponent implements OnInit, OnDestroy {
} }
public filterForKeyword(event: Event): void { public filterForKeyword(event: Event): void {
const searchValue = (<HTMLInputElement>event.target).value; const searchValue = (<HTMLInputElement>event.target).value.toString().toLowerCase();
if (searchValue.length < this._previousSearchValue.length) { if (searchValue.length < this._previousSearchValue.length) {
this._availableNicks = Object.assign({}, this._availableNicksBackup); this._availableNicks = Object.assign({}, this._availableNicksBackup);
...@@ -64,8 +66,8 @@ export class NicknameManagerComponent implements OnInit, OnDestroy { ...@@ -64,8 +66,8 @@ export class NicknameManagerComponent implements OnInit, OnDestroy {
return; return;
} }
Object.keys(this._availableNicks).forEach(category => { Object.keys(this.availableNicks).forEach(category => {
this._availableNicks[category] = this._availableNicks[category].filter(baseNick => { this.availableNicks[category] = this.availableNicks[category].filter(baseNick => {
return baseNick.toString().toLowerCase().indexOf(searchValue) > -1; return baseNick.toString().toLowerCase().indexOf(searchValue) > -1;
}); });
}); });
...@@ -75,12 +77,8 @@ export class NicknameManagerComponent implements OnInit, OnDestroy { ...@@ -75,12 +77,8 @@ export class NicknameManagerComponent implements OnInit, OnDestroy {
return this.sanitizer.bypassSecurityTrustHtml(`${value}`); return this.sanitizer.bypassSecurityTrustHtml(`${value}`);
} }
public parseAvailableNick(name: string): SafeHtml {
return name;
}
public availableNickCategories(): Array<string> { public availableNickCategories(): Array<string> {
return Object.keys(this._availableNicks || {}); return Object.keys(this.availableNicks || {});
} }
public toggleSelectedCategory(name: string): void { public toggleSelectedCategory(name: string): void {
...@@ -88,62 +86,70 @@ export class NicknameManagerComponent implements OnInit, OnDestroy { ...@@ -88,62 +86,70 @@ export class NicknameManagerComponent implements OnInit, OnDestroy {
return; return;
} }
this._selectedCategory = this._selectedCategory === name ? '' : name; this._selectedCategory = this.selectedCategory === name ? '' : name;
} }
public selectNick(name: any): void { public selectNick(name: any): void {
if (this._selectedCategory === 'emojis') { if (this.selectedCategory === 'emojis') {
name = name.changingThisBreaksApplicationSecurity.match(/:[\w\+\-]+:/g)[0]; name = name.changingThisBreaksApplicationSecurity.match(/:[\w\+\-]+:/g)[0];
} }
this.activeQuestionGroupService.activeQuestionGroup.sessionConfig.nicks.toggleSelectedNick(name.toString()); this.activeQuestionGroupService.activeQuestionGroup.sessionConfig.nicks.toggleSelectedNick(name.toString());
} }
public hasSelectedNick(name: any): boolean { public hasSelectedNick(name: any): boolean {
if (this._selectedCategory === 'emojis') { if (this.selectedCategory === 'emojis') {
name = name.changingThisBreaksApplicationSecurity.match(/:[\w\+\-]+:/g)[0]; name = name.changingThisBreaksApplicationSecurity.match(/:[\w\+\-]+:/g)[0];
} }
return this.activeQuestionGroupService.activeQuestionGroup.sessionConfig.nicks.hasSelectedNick(name.toString()); return this.activeQuestionGroupService.activeQuestionGroup.sessionConfig.nicks.hasSelectedNick(name.toString());
} }
public hasSelectedCategory(category?: string): boolean { public hasSelectedCategory(category?: string): boolean {
return category ? category === this._selectedCategory : !!this._selectedCategory; return category ? category === this.selectedCategory : !!this.selectedCategory;
} }
public hasSelectedAllNicks(): boolean { public hasSelectedAllNicks(): boolean {
const selectedNicks = this.activeQuestionGroupService.activeQuestionGroup.sessionConfig.nicks.selectedNicks; const selectedNicks = this.activeQuestionGroupService.activeQuestionGroup.sessionConfig.nicks.selectedNicks;
const filteredNicksLength = this._availableNicks[this._selectedCategory].filter(elem => { const filteredNicksLength = this.availableNicks[this.selectedCategory].filter(elem => {
if (this._selectedCategory === 'emojis') { if (this.selectedCategory === 'emojis') {
const emojiMatch = elem.changingThisBreaksApplicationSecurity.match(/:[\w\+\-]+:/g); const emojiMatch = elem.changingThisBreaksApplicationSecurity.match(/:[\w\+\-]+:/g);
return selectedNicks.indexOf(emojiMatch ? emojiMatch[0] : null) > -1; return selectedNicks.indexOf(emojiMatch ? emojiMatch[0] : null) > -1;
} else { } else {
return selectedNicks.indexOf(elem) > -1; return selectedNicks.indexOf(elem) > -1;
} }
}).length; }).length;
return filteredNicksLength === this._availableNicks[this._selectedCategory].length; return filteredNicksLength === this.availableNicks[this.selectedCategory].length;
} }
public getNumberOfSelectedNicksOfCategory(category: string): number { public getNumberOfSelectedNicksOfCategory(category: string): number {
if (!this.availableNicks[category]) {
return 0;
}
const selectedNicks = this.activeQuestionGroupService.activeQuestionGroup.sessionConfig.nicks.selectedNicks; const selectedNicks = this.activeQuestionGroupService.activeQuestionGroup.sessionConfig.nicks.selectedNicks;
return this._availableNicks[category].filter(elem => { return this.availableNicks[category].filter(elem => {
return selectedNicks.indexOf(elem) > -1; return selectedNicks.indexOf(elem) > -1;
}).length; }).length;
} }
public getNumberOfAvailableNicksForCategory(category: string): number { public getNumberOfAvailableNicksForCategory(category: string): number {
return this._availableNicks[category].length; if (!this.availableNicks[category]) {
return 0;
}
return this.availableNicks[category].length;
} }
public toggleAllNicks(): void { public toggleAllNicks(): void {
if (this.hasSelectedAllNicks()) { if (this.hasSelectedAllNicks()) {
this._availableNicks[this._selectedCategory].forEach(elem => { this.availableNicks[this.selectedCategory].forEach(elem => {
if (this._selectedCategory === 'emojis') { if (this.selectedCategory === 'emojis') {
elem = elem.changingThisBreaksApplicationSecurity.match(/:[\w\+\-]+:/g)[0]; elem = elem.changingThisBreaksApplicationSecurity.match(/:[\w\+\-]+:/g)[0];
} }
this.activeQuestionGroupService.activeQuestionGroup.sessionConfig.nicks.removeSelectedNickByName(elem.toString()); this.activeQuestionGroupService.activeQuestionGroup.sessionConfig.nicks.removeSelectedNickByName(elem.toString());
}); });
} else { } else {
this._availableNicks[this._selectedCategory].forEach(elem => { this.availableNicks[this.selectedCategory].forEach(elem => {
if (this._selectedCategory === 'emojis') { if (this.selectedCategory === 'emojis') {
elem = elem.changingThisBreaksApplicationSecurity.match(/:[\w\+\-]+:/g)[0]; elem = elem.changingThisBreaksApplicationSecurity.match(/:[\w\+\-]+:/g)[0];
} }
this.activeQuestionGroupService.activeQuestionGroup.sessionConfig.nicks.addSelectedNick(elem.toString()); this.activeQuestionGroupService.activeQuestionGroup.sessionConfig.nicks.addSelectedNick(elem.toString());
...@@ -152,11 +158,8 @@ export class NicknameManagerComponent implements OnInit, OnDestroy { ...@@ -152,11 +158,8 @@ export class NicknameManagerComponent implements OnInit, OnDestroy {
} }
public ngOnInit(): void { public ngOnInit(): void {
const headers = new HttpHeaders(); this.http.get<IAvailableNicks>(`${DefaultSettings.httpApiEndpoint}/nicks/predefined`).subscribe(
headers.append('Content-Type', 'multipart/form-data'); data => {
headers.append('Accept', 'application/json');
this.http.get(`${DefaultSettings.httpApiEndpoint}/nicks/predefined`, { headers }).subscribe(
(data: IAvailableNicks) => {
this.availableNicks = data; this.availableNicks = data;
}, },
error => { error => {
......
import { HttpClient, HttpClientModule } from '@angular/common/http'; import { HttpClient, HttpClientModule } from '@angular/common/http';
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { NgbModalModule } from '@ng-bootstrap/ng-bootstrap'; import { NgbModalModule } from '@ng-bootstrap/ng-bootstrap';
import { TranslateCompiler, TranslateLoader, TranslateModule } from '@ngx-translate/core'; import { TranslateCompiler, TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { DefaultAnswerOption } from 'arsnova-click-v2-types/src/answeroptions/answeroption_default';
import { IQuestionSurvey } from 'arsnova-click-v2-types/src/questions/interfaces';
import { TranslateMessageFormatCompiler } from 'ngx-translate-messageformat-compiler'; import { TranslateMessageFormatCompiler } from 'ngx-translate-messageformat-compiler';
import { createTranslateLoader } from '../../../../../../lib/translation.factory'; import { createTranslateLoader } from '../../../../../../lib/translation.factory';
import { HeaderComponent } from '../../../../../header/header/header.component'; import { HeaderComponent } from '../../../../../header/header/header.component';
...@@ -24,7 +26,7 @@ import { WebsocketService } from '../../../../../service/websocket/websocket.ser ...@@ -24,7 +26,7 @@ import { WebsocketService } from '../../../../../service/websocket/websocket.ser
import { AnsweroptionsDefaultComponent } from './answeroptions-default.component'; import { AnsweroptionsDefaultComponent } from './answeroptions-default.component';
class MockRouter { class MockRouterSC {
public params = { public params = {
subscribe: (cb) => { subscribe: (cb) => {
cb({ cb({
...@@ -34,55 +36,141 @@ class MockRouter { ...@@ -34,55 +36,141 @@ class MockRouter {
}; };
} }
class MockRouterSurvey {
public params = {
subscribe: (cb) => {
cb({
questionIndex: 3,
});
},
};
}
const imports = [
RouterTestingModule,
HttpClientModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: (createTranslateLoader),
deps: [HttpClient],
},
compiler: {
provide: TranslateCompiler,
useClass: TranslateMessageFormatCompiler,
},
}),
NgbModalModule.forRoot(),
];
const providers: Array<any> = [
{ provide: ActiveQuestionGroupService, useClass: ActiveQuestionGroupMockService },
FooterBarService,
SettingsService,
{ provide: ConnectionService, useClass: ConnectionMockService },
{ provide: WebsocketService, useClass: WebsocketMockService },
SharedService,
HeaderLabelService,
QuestionTextService,
{ provide: TrackingService, useClass: TrackingMockService },
];
const declarations = [
HeaderComponent,
LivePreviewComponent,
AnsweroptionsDefaultComponent,
];
describe('AnsweroptionsDefaultComponent', () => { describe('AnsweroptionsDefaultComponent', () => {
let component: AnsweroptionsDefaultComponent;
let fixture: ComponentFixture<AnsweroptionsDefaultComponent>; describe('SingleChoiceQuestion', () => {
let component: AnsweroptionsDefaultComponent;
beforeEach(async(() => { let fixture: ComponentFixture<AnsweroptionsDefaultComponent>;
TestBed.configureTestingModule({
imports: [ beforeEach((() => {
RouterTestingModule, providers.push({ provide: ActivatedRoute, useClass: MockRouterSC });
HttpClientModule,
TranslateModule.forRoot({ TestBed.configureTestingModule({ imports, providers, declarations }).compileComponents();
loader: { }));
provide: TranslateLoader,
useFactory: (createTranslateLoader), beforeEach((() => {
deps: [HttpClient], fixture = TestBed.createComponent(AnsweroptionsDefaultComponent);
}, component = fixture.componentInstance;
compiler: { fixture.detectChanges();
provide: TranslateCompiler, }));
useClass: TranslateMessageFormatCompiler,
}, it('should be created', (() => {
}), expect(component).toBeTruthy();
NgbModalModule.forRoot(), }));
], it('should contain a TYPE reference', (() => {
providers: [ expect(AnsweroptionsDefaultComponent.TYPE).toEqual('AnsweroptionsDefaultComponent');
{ provide: ActiveQuestionGroupService, useClass: ActiveQuestionGroupMockService }, }));
FooterBarService,
SettingsService, describe('#addAnswer', () => {
{ provide: ConnectionService, useClass: ConnectionMockService }, it('should add an answer', () => {
{ provide: WebsocketService, useClass: WebsocketMockService }, component.addAnswer();
SharedService, expect(component.question.answerOptionList.length).toEqual(1);
HeaderLabelService, expect(component.question.answerOptionList[0].TYPE).toEqual('DefaultAnswerOption');
QuestionTextService, });
{ provide: ActivatedRoute, useClass: MockRouter }, });
{ provide: TrackingService, useClass: TrackingMockService },
], describe('#deleteAnswer', () => {
declarations: [ it('should delete an answer', () => {
HeaderComponent, component.deleteAnswer(0);
LivePreviewComponent, expect(component.question.answerOptionList.length).toEqual(0);
AnsweroptionsDefaultComponent, });
], });
}).compileComponents();
})); describe('#updateAnswerValue', () => {
it('should update the answertext', () => {
beforeEach(async(() => { const value = 'newValue';
fixture = TestBed.createComponent(AnsweroptionsDefaultComponent); const event = <any>{ target: { value } };
component = fixture.componentInstance; component.addAnswer();
fixture.detectChanges(); component.updateAnswerValue(event, 0);
})); expect(component.question.answerOptionList[0].answerText).toEqual(value);
});
it('should be created', async(() => { });
expect(component).toBeTruthy();
})); describe('#toggleShowOneAnswerPerRow', () => {
it('should toggle the showOneAnswerPerRow option of the question', () => {
const initValue = component.question.showOneAnswerPerRow;
component.toggleShowOneAnswerPerRow();
expect(component.question.showOneAnswerPerRow).not.toEqual(initValue);
});
});
describe('#toggleShowAnswerContentOnButtons', () => {
it('should toggle the displayAnswerText option of the question', () => {
const initValue = component.question.displayAnswerText;
component.toggleShowAnswerContentOnButtons();
expect(component.question.displayAnswerText).not.toEqual(initValue);
});
});
});
describe('SurveyQuestion', () => {
let component: AnsweroptionsDefaultComponent;
let fixture: ComponentFixture<AnsweroptionsDefaultComponent>;
beforeEach((() => {
providers.push({ provide: ActivatedRoute, useClass: MockRouterSurvey });
TestBed.configureTestingModule({ imports, providers, declarations }).compileComponents();
}));
beforeEach((() => {
fixture = TestBed.createComponent(AnsweroptionsDefaultComponent);
component = fixture.componentInstance;
fixture.detectChanges();
}));
describe('#toggleMultipleSelectionSurvey', () => {
it('should toggle the multipleSelectionEnabled option of a survey question', () => {
const initValue = (<IQuestionSurvey>component.question).multipleSelectionEnabled;
component.toggleMultipleSelectionSurvey();
expect((<IQuestionSurvey>component.question).multipleSelectionEnabled).not.toEqual(initValue);
});
});
});
}); });
import { HttpClient, HttpClientModule } from '@angular/common/http'; import { HttpClient, HttpClientModule } from '@angular/common/http';
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { TranslateCompiler, TranslateLoader, TranslateModule } from '@ngx-translate/core'; import { TranslateCompiler, TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { IFreetextAnswerOption } from 'arsnova-click-v2-types/src/answeroptions/interfaces';
import { TranslateMessageFormatCompiler } from 'ngx-translate-messageformat-compiler'; import { TranslateMessageFormatCompiler } from 'ngx-translate-messageformat-compiler';
import { createTranslateLoader } from '../../../../../../lib/translation.factory'; import { createTranslateLoader } from '../../../../../../lib/translation.factory';
import { ActiveQuestionGroupMockService } from '../../../../../service/active-question-group/active-question-group.mock.service'; import { ActiveQuestionGroupMockService } from '../../../../../service/active-question-group/active-question-group.mock.service';
...@@ -32,7 +33,7 @@ describe('AnsweroptionsFreetextComponent', () => { ...@@ -32,7 +33,7 @@ describe('AnsweroptionsFreetextComponent', () => {
let component: AnsweroptionsFreetextComponent; let component: AnsweroptionsFreetextComponent;
let fixture: ComponentFixture<AnsweroptionsFreetextComponent>; let fixture: ComponentFixture<AnsweroptionsFreetextComponent>;
beforeEach(async(() => { beforeEach((() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
imports: [ imports: [
RouterTestingModule, RouterTestingModule,
...@@ -63,13 +64,81 @@ describe('AnsweroptionsFreetextComponent', () => { ...@@ -63,13 +64,81 @@ describe('AnsweroptionsFreetextComponent', () => {
}).compileComponents(); }).compileComponents();
})); }));
beforeEach(async(() => { beforeEach((() => {
fixture = TestBed.createComponent(AnsweroptionsFreetextComponent); fixture = TestBed.createComponent(AnsweroptionsFreetextComponent);
component = fixture.componentInstance; component = fixture.componentInstance;
fixture.detectChanges(); fixture.detectChanges();
})); }));
it('should be created', async(() => { it('should be created', (() => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
})); }));
it('should contain a TYPE reference', (() => {
expect(AnsweroptionsFreetextComponent.TYPE).toEqual('AnsweroptionsFreetextComponent');
}));
describe('#setTestInput', () => {
it('should add a test input', () => {
const value = 'Testinputvalue';
const event = <any>{ target: { value } };
component.setTestInput(event);
expect(component.testInput).toEqual(value);
});
});
describe('#setMatchText', () => {
it('should add a match text to the answer text', () => {