mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 05:53:03 +00:00
[DURACOM-191] fix various tests
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Router } from '@angular/router';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Observable, of as observableOf } from 'rxjs';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
@@ -30,6 +30,7 @@ import { FindListOptions } from '../../core/data/find-list-options.model';
|
||||
import { EPersonFormComponent } from './eperson-form/eperson-form.component';
|
||||
import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component';
|
||||
import { PaginationComponent } from '../../shared/pagination/pagination.component';
|
||||
import { MockActivatedRoute } from '../../shared/mocks/active-router.mock';
|
||||
|
||||
describe('EPeopleRegistryComponent', () => {
|
||||
let component: EPeopleRegistryComponent;
|
||||
@@ -134,6 +135,7 @@ describe('EPeopleRegistryComponent', () => {
|
||||
}
|
||||
}), EPeopleRegistryComponent],
|
||||
providers: [
|
||||
{ provide: ActivatedRoute, useValue: new MockActivatedRoute() },
|
||||
{provide: EPersonDataService, useValue: ePersonDataServiceStub},
|
||||
{provide: NotificationsService, useValue: new NotificationsServiceStub()},
|
||||
{provide: AuthorizationDataService, useValue: authorizationService},
|
||||
|
@@ -1,10 +1,11 @@
|
||||
import { ForgotEmailComponent } from './forgot-email.component';
|
||||
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { RegisterEmailFormComponent } from '../../register-email-form/register-email-form.component';
|
||||
import { provideMockStore } from '@ngrx/store/testing';
|
||||
|
||||
describe('ForgotEmailComponent', () => {
|
||||
let comp: ForgotEmailComponent;
|
||||
@@ -13,6 +14,7 @@ describe('ForgotEmailComponent', () => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CommonModule, TranslateModule.forRoot(), ReactiveFormsModule, ForgotEmailComponent],
|
||||
providers: [provideMockStore()],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
})
|
||||
.overrideComponent(ForgotEmailComponent, {
|
||||
|
@@ -20,6 +20,7 @@ import { ThemedAuthNavMenuComponent } from '../shared/auth-nav-menu/themed-auth-
|
||||
import { ImpersonateNavbarComponent } from '../shared/impersonate-navbar/impersonate-navbar.component';
|
||||
import { HostWindowService } from '../shared/host-window.service';
|
||||
import { HostWindowServiceStub } from '../shared/testing/host-window-service.stub';
|
||||
import { provideMockStore } from '@ngrx/store/testing';
|
||||
|
||||
let comp: HeaderComponent;
|
||||
let fixture: ComponentFixture<HeaderComponent>;
|
||||
@@ -44,6 +45,7 @@ describe('HeaderComponent', () => {
|
||||
HeaderComponent
|
||||
],
|
||||
providers: [
|
||||
provideMockStore(),
|
||||
{ provide: MenuService, useValue: menuService },
|
||||
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub()},
|
||||
{ provide: LocaleService, useValue: mockLocaleService },
|
||||
|
@@ -1,10 +1,11 @@
|
||||
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { RegisterEmailComponent } from './register-email.component';
|
||||
import { RegisterEmailFormComponent } from '../../register-email-form/register-email-form.component';
|
||||
import { provideMockStore } from '@ngrx/store/testing';
|
||||
|
||||
describe('RegisterEmailComponent', () => {
|
||||
|
||||
@@ -13,6 +14,7 @@ describe('RegisterEmailComponent', () => {
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [provideMockStore()],
|
||||
imports: [CommonModule, TranslateModule.forRoot(), ReactiveFormsModule, RegisterEmailComponent],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
})
|
||||
|
@@ -39,6 +39,7 @@ import { ThemedSearchResultsComponent } from './search-results/themed-search-res
|
||||
import { ThemedSearchSidebarComponent } from './search-sidebar/themed-search-sidebar.component';
|
||||
import { ThemedSearchFormComponent } from '../search-form/themed-search-form.component';
|
||||
import { SearchLabelsComponent } from './search-labels/search-labels.component';
|
||||
import { provideMockStore } from '@ngrx/store/testing';
|
||||
|
||||
let comp: SearchComponent;
|
||||
let fixture: ComponentFixture<SearchComponent>;
|
||||
@@ -209,9 +210,7 @@ export function configureSearchComponentTestingModule(compType, additionalDeclar
|
||||
},
|
||||
{ provide: ActivatedRoute, useValue: activatedRouteStub },
|
||||
{ provide: RouteService, useValue: routeServiceStub },
|
||||
{
|
||||
provide: Store, useValue: store
|
||||
},
|
||||
provideMockStore(),
|
||||
{
|
||||
provide: HostWindowService, useValue: jasmine.createSpyObj('hostWindowService', {
|
||||
isXs: observableOf(true),
|
||||
|
@@ -25,7 +25,9 @@ import {
|
||||
createSuccessfulRemoteDataObject$
|
||||
} from '../../shared/remote-data.utils';
|
||||
import { ExternalSourceEntry } from '../../core/shared/external-source-entry.model';
|
||||
import { SubmissionImportExternalPreviewComponent } from './import-external-preview/submission-import-external-preview.component';
|
||||
import {
|
||||
SubmissionImportExternalPreviewComponent
|
||||
} from './import-external-preview/submission-import-external-preview.component';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { HostWindowService } from '../../shared/host-window.service';
|
||||
@@ -36,6 +38,7 @@ import {
|
||||
} from './import-external-searchbar/submission-import-external-searchbar.component';
|
||||
import { ThemeService } from '../../shared/theme-support/theme.service';
|
||||
import { getMockThemeService } from '../../shared/mocks/theme-service.mock';
|
||||
import { provideMockStore } from '@ngrx/store/testing';
|
||||
|
||||
describe('SubmissionImportExternalComponent test suite', () => {
|
||||
let comp: SubmissionImportExternalComponent;
|
||||
@@ -65,6 +68,7 @@ describe('SubmissionImportExternalComponent test suite', () => {
|
||||
VarDirective
|
||||
],
|
||||
providers: [
|
||||
provideMockStore(),
|
||||
{ provide: ExternalSourceDataService, useValue: mockExternalSourceService },
|
||||
{ provide: SearchConfigurationService, useValue: searchConfigServiceStub },
|
||||
{ provide: RouteService, useValue: routeServiceStub },
|
||||
|
Reference in New Issue
Block a user