Commit e50dd6e4 authored by Stefan Schindler's avatar Stefan Schindler

tests fixed

parent 3fac49ee
......@@ -24,6 +24,7 @@ import { SharedModule } from '../../shared/shared.module';
import { I18nTestingModule } from '../../shared/testing/i18n-testing/i18n-testing.module';
import { FooterBarComponent } from './footer-bar.component';
import {environment} from '../../../environments/environment';
describe('FooterBarComponent', () => {
let component: FooterBarComponent;
......@@ -80,7 +81,11 @@ describe('FooterBarComponent', () => {
it('#getLinkTarget', (
inject([FooterBarService], (footerBarService: FooterBarService) => {
expect(component.getLinkTarget(footerBarService.footerElemAbout)).toEqual(jasmine.arrayContaining(['info', 'tos']));
if (environment.infoAboutTabEnabled) {
expect(component.getLinkTarget(footerBarService.footerElemAbout)).toEqual(jasmine.arrayContaining(['info', 'about']));
} else {
expect(component.getLinkTarget(footerBarService.footerElemAbout)).toEqual(jasmine.arrayContaining(['info', 'tos']));
}
})
));
......
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { BonusTokenComponent } from './bonus-token.component';
import {NgbActiveModal} from '@ng-bootstrap/ng-bootstrap';
import {HttpClient, HttpHandler} from '@angular/common/http';
import {JWT_OPTIONS, JwtHelperService, JwtModule} from '@auth0/angular-jwt';
import {jwtOptionsFactory} from '../../../../../lib/jwt.factory';
import {PLATFORM_ID} from '@angular/core';
import {
MissingTranslationHandler,
TranslateCompiler,
TranslateFakeCompiler,
TranslateFakeLoader,
TranslateLoader,
TranslateParser, TranslatePipe,
TranslateService,
TranslateStore
} from '@ngx-translate/core';
import {TranslateServiceMock} from '../../../../../../_mocks/_services/TranslateServiceMock';
import {TranslatePipeMock} from '../../../../../../_mocks/_pipes/TranslatePipeMock';
import {MissingTranslationError} from '@angular/localize/src/utils';
import {I18nTestingModule} from '../../../../../shared/testing/i18n-testing/i18n-testing.module';
import {SharedModule} from '../../../../../shared/shared.module';
import {RouterTestingModule} from '@angular/router/testing';
import {RxStompRPCService, RxStompService} from '@stomp/ng2-stompjs';
import {MarkdownService, MarkedOptions} from 'ngx-markdown';
import {StorageService} from '../../../../../service/storage/storage.service';
import {StorageServiceMock} from '../../../../../service/storage/storage.service.mock';
import {FooterBarService} from '../../../../../service/footer-bar/footer-bar.service';
import {SettingsService} from '../../../../../service/settings/settings.service';
import {ConnectionService} from '../../../../../service/connection/connection.service';
import {ConnectionMockService} from '../../../../../service/connection/connection.mock.service';
import {QuizService} from '../../../../../service/quiz/quiz.service';
import {QuizMockService} from '../../../../../service/quiz/quiz-mock.service';
import {SharedService} from '../../../../../service/shared/shared.service';
import {AttendeeService} from '../../../../../service/attendee/attendee.service';
import {AttendeeMockService} from '../../../../../service/attendee/attendee.mock.service';
describe('BonusTokenComponent', () => {
let component: BonusTokenComponent;
......@@ -8,7 +42,48 @@ describe('BonusTokenComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ BonusTokenComponent ]
imports: [
I18nTestingModule, SharedModule, RouterTestingModule, JwtModule.forRoot({
jwtOptionsProvider: {
provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory,
deps: [PLATFORM_ID],
}
})
],
declarations: [ BonusTokenComponent ],
providers: [
NgbActiveModal, HttpClient, HttpHandler, JwtHelperService,
{
provide: TranslateService,
useClass: TranslateServiceMock
}, TranslateStore, {
provide: TranslateLoader,
useClass: TranslateFakeLoader
}, {
provide: TranslateCompiler,
useClass: TranslateFakeCompiler
}, TranslateParser, {
provide: TranslatePipe,
useClass: TranslatePipeMock
}, RxStompRPCService, MarkdownService, {
provide: MarkedOptions,
useValue: {},
}, RxStompService, {
provide: StorageService,
useClass: StorageServiceMock,
}, TranslateService, FooterBarService, SettingsService, {
provide: ConnectionService,
useClass: ConnectionMockService,
}, {
provide: QuizService,
useClass: QuizMockService,
}, SharedService, {
provide: AttendeeService,
useClass: AttendeeMockService,
},
]
})
.compileComponents();
}));
......
......@@ -417,7 +417,8 @@ export class FooterBarService {
showIntro: false,
introTranslate: 'region.footer.footer_bar.showToken',
linkTarget: null,
}, function (): void {});
}, function (): void {
});
private _footerElements: Array<IFooterBarElement> = [];
......
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