Commit ae72c7ef authored by Christopher Mark Fullarton's avatar Christopher Mark Fullarton
Browse files

Fixes linting errors

parent 63345885
......@@ -9,7 +9,6 @@ import { FooterBarService } from '../../service/footer-bar/footer-bar.service';
import { QuizService } from '../../service/quiz/quiz.service';
import { UserService } from '../../service/user/user.service';
import { I18nTestingModule } from '../../shared/testing/i18n-testing/i18n-testing.module';
import { AdminSettingsComponent } from './admin-settings.component';
describe('AdminSettingsComponent', () => {
......@@ -36,7 +35,7 @@ describe('AdminSettingsComponent', () => {
{
provide: QuizService,
useValue: {
loadDataToEdit: () => new Promise(resolve => resolve()),
loadDataToEdit: () => new Promise<void>(resolve => resolve()),
},
},
{
......
......@@ -44,10 +44,13 @@ describe('AnswerResultComponent', () => {
{provide: FooterBarService, useValue: {
replaceFooterElements: () => {},
}},
{provide: QuizService, useValue: {
quiz: {},
loadDataToPlay: () => new Promise(resolve => resolve()),
}},
{
provide: QuizService,
useValue: {
quiz: {},
loadDataToPlay: () => new Promise<void>(resolve => resolve()),
}
},
{provide: AttendeeService, useClass: AttendeeMockService},
{provide: CustomMarkdownService, useClass: CustomMarkdownServiceMock},
{provide: HotkeysService, useValue: {}},
......
......@@ -119,21 +119,6 @@ describe('QuizLobbyComponent', () => {
expect(component['_kickMemberModalRef']).not.toBeNull();
}));
it('#kickMember', waitForAsync(() => {
const modalService = TestBed.inject(NgbModal);
const modalContent = '<div></div>' as unknown as TemplateRef<any>;
const nickToRemove = 'TestNick';
component['_ownsQuiz'] = true;
spyOn(modalService, 'open').and.returnValue({ close: () => {} } as NgbModalRef);
spyOn(component, 'kickMember').and.callThrough();
component.openKickMemberModal(modalContent, nickToRemove);
component.kickMember(nickToRemove);
expect(component.kickMember).toHaveBeenCalled();
}));
it('#hexToRgb', () => {
expect(ColorTransform.hexToRgb('#ffffff')).toEqual({
r: 255,
......
......@@ -84,7 +84,7 @@ describe('QuestionDetailsComponent', () => {
provide: QuizService,
useValue: {
quizUpdateEmitter: of(null),
loadDataToPlay: () => new Promise(resolve => resolve()),
loadDataToPlay: () => new Promise<void>(resolve => resolve()),
quiz: {
questionList: [],
}
......
......@@ -65,7 +65,7 @@ describe('QuizFlow: ReadingConfirmationComponent', () => {
provide: QuizService,
useValue: {
quizUpdateEmitter: of(null),
loadDataToPlay: () => new Promise(resolve => resolve()),
loadDataToPlay: () => new Promise<void>(resolve => resolve()),
currentQuestion: () => ({}),
},
}, QuestionTextService, HeaderLabelService, {
......
......@@ -61,7 +61,7 @@ describe('VotingComponent', () => {
provide: QuizService,
useValue: {
quizUpdateEmitter: of(null),
loadDataToPlay: () => new Promise(resolve => resolve()),
loadDataToPlay: () => new Promise<void>(resolve => resolve()),
currentQuestion: () => ({}),
},
}, {
......
......@@ -68,7 +68,7 @@ describe('AnsweroptionsDefaultComponent', () => {
provide: QuizService,
useValue: {
quizUpdateEmitter: of(null),
loadDataToEdit: () => new Promise(resolve => resolve()),
loadDataToEdit: () => new Promise<void>(resolve => resolve()),
quiz: {
currentQuestionIndex: 0,
questionList: [
......
......@@ -53,7 +53,7 @@ describe('AnsweroptionsFreetextComponent', () => {
provide: QuizService,
useValue: {
quizUpdateEmitter: of(null),
loadDataToEdit: () => new Promise(resolve => resolve()),
loadDataToEdit: () => new Promise<void>(resolve => resolve()),
quiz: {
currentQuestionIndex: 0,
questionList: [
......
......@@ -52,7 +52,7 @@ describe('AnsweroptionsRangedComponent', () => {
provide: QuizService,
useValue: {
quizUpdateEmitter: of(null),
loadDataToEdit: () => new Promise(resolve => resolve()),
loadDataToEdit: () => new Promise<void>(resolve => resolve()),
quiz: {
currentQuestionIndex: 0,
questionList: [
......
......@@ -75,7 +75,7 @@ describe('AnsweroptionsComponent', () => {
}, {
provide: QuizService,
useValue: {
loadDataToEdit: () => new Promise(resolve => resolve()),
loadDataToEdit: () => new Promise<void>(resolve => resolve()),
quizUpdateEmitter: of(null),
},
}, HeaderLabelService, {
......
......@@ -52,7 +52,7 @@ describe('CountdownComponent', () => {
provide: QuizService,
useValue: {
quizUpdateEmitter: of(null),
loadDataToEdit: () => new Promise(resolve => resolve()),
loadDataToEdit: () => new Promise<void>(resolve => resolve()),
quiz: {
currentQuestionIndex: 0,
questionList: [
......
......@@ -56,7 +56,7 @@ describe('QuizManagerDetailsOverviewComponent', () => {
provide: QuizService,
useValue: {
quizUpdateEmitter: of(null),
loadDataToEdit: () => new Promise(resolve => resolve()),
loadDataToEdit: () => new Promise<void>(resolve => resolve()),
},
}, {
provide: ThemesService,
......
......@@ -90,7 +90,7 @@ describe('QuestiontextComponent', () => {
provide: QuizService,
useValue: {
quizUpdateEmitter: of(null),
loadDataToEdit: () => new Promise(resolve => resolve()),
loadDataToEdit: () => new Promise<void>(resolve => resolve()),
},
}, HeaderLabelService, {
provide: ThemesService,
......
......@@ -51,7 +51,7 @@ describe('QuestiontypeComponent', () => {
provide: QuizService,
useValue: {
quizUpdateEmitter: of(null),
loadDataToEdit: () => new Promise(resolve => resolve()),
loadDataToEdit: () => new Promise<void>(resolve => resolve()),
persist: () => {},
quiz: {
currentQuestionIndex: 0,
......
......@@ -65,7 +65,7 @@ describe('MemberGroupManagerComponent', () => {
provide: QuizService,
useValue: {
quizUpdateEmitter: of(null),
loadDataToEdit: () => new Promise(resolve => resolve()),
loadDataToEdit: () => new Promise<void>(resolve => resolve()),
},
}, {
provide: SettingsService,
......
......@@ -87,7 +87,7 @@ describe('NicknameManagerComponent', () => {
}, {
provide: QuizService,
useValue: {
loadDataToEdit: () => new Promise(resolve => resolve()),
loadDataToEdit: () => new Promise<void>(resolve => resolve()),
removeSelectedNickByName: () => {},
addSelectedNick: () => {},
toggleSelectedNick: () => {},
......
......@@ -61,7 +61,7 @@ describe('QuizManagerComponent', () => {
}, HeaderLabelService, {
provide: QuizService,
useValue: {
loadDataToEdit: () => new Promise(resolve => resolve()),
loadDataToEdit: () => new Promise<void>(resolve => resolve()),
quizUpdateEmitter: of(null),
close: () => of(null),
persist: () => {},
......
......@@ -56,7 +56,7 @@ describe('SoundManagerComponent', () => {
provide: QuizService,
useValue: {
quizUpdateEmitter: new Subject(),
loadDataToEdit: () => new Promise(resolve => resolve()),
loadDataToEdit: () => new Promise<void>(resolve => resolve()),
quiz: {
sessionConfig: {}
}
......
......@@ -141,7 +141,7 @@ describe('QuizOverviewComponent', () => {
const quizName = 'validtestquiz';
spyOn(router, 'navigate').and.callFake(() => new Promise<boolean>(resolve => {resolve(); }));
spyOn(router, 'navigate').and.callFake(() => new Promise<boolean>(resolve => resolve(false)));
component.startQuiz(validQuiz).then(() => {
expect(quizService.quiz).toEqual(jasmine.objectContaining(validQuiz));
......@@ -153,7 +153,7 @@ describe('QuizOverviewComponent', () => {
describe('#editQuiz', () => {
it('should redirect to the quiz manager', inject([QuizService, Router], (quizService: QuizService, router: Router) => {
spyOn(router, 'navigate').and.callFake(() => new Promise<boolean>(resolve => {resolve(); }));
spyOn(router, 'navigate').and.callFake(() => new Promise<boolean>(resolve => resolve(false)));
component.sessions.splice(0, -1, validQuiz);
component.editQuiz(validQuiz);
......
......@@ -153,7 +153,7 @@ describe('HomeComponent', () => {
it('should join the session by click', waitForAsync(inject([Router], (router: Router) => {
spyOn(component, 'selectQuizByList').and.callThrough();
spyOn(router, 'navigate').and.callFake(() => new Promise<boolean>(resolve => {resolve(); }));
spyOn(router, 'navigate').and.callFake(() => new Promise<boolean>(resolve => resolve(false)));
component.autoJoinToSession('testquiz');
expect(component.selectQuizByList).toHaveBeenCalled();
......
Supports Markdown
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