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