diff --git a/src/app/core/data/eperson-registration.service.spec.ts b/src/app/core/data/eperson-registration.service.spec.ts index a653f05e33..d8623e7046 100644 --- a/src/app/core/data/eperson-registration.service.spec.ts +++ b/src/app/core/data/eperson-registration.service.spec.ts @@ -1,11 +1,11 @@ import { RequestService } from './request.service'; import { EpersonRegistrationService } from './eperson-registration.service'; -import { HALEndpointServiceStub } from '../../shared/testing/hal-endpoint-service-stub'; import { RegistrationSuccessResponse, RestResponse } from '../cache/response.models'; import { RequestEntry } from './request.reducer'; import { cold } from 'jasmine-marbles'; import { PostRequest } from './request.models'; import { Registration } from '../shared/registration.model'; +import { HALEndpointServiceStub } from '../../shared/testing/hal-endpoint-service.stub'; describe('EpersonRegistrationService', () => { let service: EpersonRegistrationService; diff --git a/src/app/register-page/create-profile/create-profile.component.spec.ts b/src/app/register-page/create-profile/create-profile.component.spec.ts index 04e1d0ffdc..5fed324a22 100644 --- a/src/app/register-page/create-profile/create-profile.component.spec.ts +++ b/src/app/register-page/create-profile/create-profile.component.spec.ts @@ -9,16 +9,15 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { Store } from '@ngrx/store'; import { FormBuilder, ReactiveFormsModule } from '@angular/forms'; import { EPersonDataService } from '../../core/eperson/eperson-data.service'; -import { RouterStub } from '../../shared/testing/router-stub'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { of as observableOf } from 'rxjs'; import { RestResponse } from '../../core/cache/response.models'; import { By } from '@angular/platform-browser'; -import { GLOBAL_CONFIG } from '../../../config'; import { CoreState } from '../../core/core.reducers'; -import { NotificationsServiceStub } from '../../shared/testing/notifications-service-stub'; import { EPerson } from '../../core/eperson/models/eperson.model'; import { AuthenticateAction } from '../../core/auth/auth.actions'; +import { RouterStub } from '../../shared/testing/router.stub'; +import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub'; describe('CreateProfileComponent', () => { let comp: CreateProfileComponent; @@ -90,7 +89,6 @@ describe('CreateProfileComponent', () => { imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), ReactiveFormsModule], declarations: [CreateProfileComponent], providers: [ - {provide: GLOBAL_CONFIG, useValue: mockConfig}, {provide: Router, useValue: router}, {provide: ActivatedRoute, useValue: route}, {provide: Store, useValue: store}, diff --git a/src/app/register-page/create-profile/create-profile.component.ts b/src/app/register-page/create-profile/create-profile.component.ts index 947a8ac1ef..9b892bdcfc 100644 --- a/src/app/register-page/create-profile/create-profile.component.ts +++ b/src/app/register-page/create-profile/create-profile.component.ts @@ -9,11 +9,11 @@ import { TranslateService } from '@ngx-translate/core'; import { EPersonDataService } from '../../core/eperson/eperson-data.service'; import { EPerson } from '../../core/eperson/models/eperson.model'; import { LangConfig } from '../../../config/lang-config.interface'; -import { GLOBAL_CONFIG, GlobalConfig } from '../../../config'; import { Store } from '@ngrx/store'; import { CoreState } from '../../core/core.reducers'; import { AuthenticateAction } from '../../core/auth/auth.actions'; import { NotificationsService } from '../../shared/notifications/notifications.service'; +import { environment } from '../../../environments/environment'; /** * Component that renders the create profile page to be used by a user registering through a token @@ -33,7 +33,6 @@ export class CreateProfileComponent implements OnInit { activeLangs: LangConfig[]; constructor( - @Inject(GLOBAL_CONFIG) public config: GlobalConfig, private translateService: TranslateService, private ePersonDataService: EPersonDataService, private store: Store, @@ -53,7 +52,7 @@ export class CreateProfileComponent implements OnInit { this.email = registration.email; this.token = registration.token; }); - this.activeLangs = this.config.languages.filter((MyLangConfig) => MyLangConfig.active === true); + this.activeLangs = environment.languages.filter((MyLangConfig) => MyLangConfig.active === true); this.userInfoForm = this.formBuilder.group({ firstName: new FormControl('', { diff --git a/src/app/register-page/register-email/register-email.component.spec.ts b/src/app/register-page/register-email/register-email.component.spec.ts index eb95fd220e..67986853ea 100644 --- a/src/app/register-page/register-email/register-email.component.spec.ts +++ b/src/app/register-page/register-email/register-email.component.spec.ts @@ -1,7 +1,5 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { of as observableOf } from 'rxjs'; -import { RouterStub } from '../../shared/testing/router-stub'; -import { NotificationsServiceStub } from '../../shared/testing/notifications-service-stub'; import { RestResponse } from '../../core/cache/response.models'; import { CommonModule } from '@angular/common'; import { RouterTestingModule } from '@angular/router/testing'; @@ -13,6 +11,8 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { RegisterEmailComponent } from './register-email.component'; import { EpersonRegistrationService } from '../../core/data/eperson-registration.service'; import { By } from '@angular/platform-browser'; +import { RouterStub } from '../../shared/testing/router.stub'; +import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub'; describe('RegisterEmailComponent', () => {