mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
[DURACOM-234] Fix tests
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
|||||||
Store,
|
Store,
|
||||||
StoreModule,
|
StoreModule,
|
||||||
} from '@ngrx/store';
|
} from '@ngrx/store';
|
||||||
|
import { createMockStore } from '@ngrx/store/testing';
|
||||||
import {
|
import {
|
||||||
TranslateLoader,
|
TranslateLoader,
|
||||||
TranslateModule,
|
TranslateModule,
|
||||||
@@ -51,7 +52,6 @@ import { RequestService } from '../data/request.service';
|
|||||||
import { HttpOptions } from '../dspace-rest/dspace-rest.service';
|
import { HttpOptions } from '../dspace-rest/dspace-rest.service';
|
||||||
import { Item } from '../shared/item.model';
|
import { Item } from '../shared/item.model';
|
||||||
import { GroupDataService } from './group-data.service';
|
import { GroupDataService } from './group-data.service';
|
||||||
import { createMockStore } from '@ngrx/store/testing';
|
|
||||||
|
|
||||||
describe('GroupDataService', () => {
|
describe('GroupDataService', () => {
|
||||||
let service: GroupDataService;
|
let service: GroupDataService;
|
||||||
|
@@ -10,6 +10,7 @@ import {
|
|||||||
NavigationEnd,
|
NavigationEnd,
|
||||||
Router,
|
Router,
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
|
import { createMockStore } from '@ngrx/store/testing';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import {
|
import {
|
||||||
Observable,
|
Observable,
|
||||||
@@ -45,7 +46,6 @@ import {
|
|||||||
ClearMetaTagAction,
|
ClearMetaTagAction,
|
||||||
} from './meta-tag.actions';
|
} from './meta-tag.actions';
|
||||||
import { MetadataService } from './metadata.service';
|
import { MetadataService } from './metadata.service';
|
||||||
import { createMockStore } from '@ngrx/store/testing';
|
|
||||||
|
|
||||||
describe('MetadataService', () => {
|
describe('MetadataService', () => {
|
||||||
let metadataService: MetadataService;
|
let metadataService: MetadataService;
|
||||||
|
@@ -17,7 +17,6 @@ import {
|
|||||||
UntypedFormGroup,
|
UntypedFormGroup,
|
||||||
} from '@angular/forms';
|
} from '@angular/forms';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';
|
|
||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import {
|
import {
|
||||||
DYNAMIC_FORM_CONTROL_MAP_FN,
|
DYNAMIC_FORM_CONTROL_MAP_FN,
|
||||||
|
@@ -1,9 +1,10 @@
|
|||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
|
import { createMockStore } from '@ngrx/store/testing';
|
||||||
|
import { MockStore } from '@ngrx/store/testing/mock_store';
|
||||||
import {
|
import {
|
||||||
cold,
|
cold,
|
||||||
hot,
|
hot,
|
||||||
} from 'jasmine-marbles';
|
} from 'jasmine-marbles';
|
||||||
import { of as observableOf } from 'rxjs';
|
|
||||||
|
|
||||||
import { AppState } from '../app.reducer';
|
import { AppState } from '../app.reducer';
|
||||||
import {
|
import {
|
||||||
@@ -11,8 +12,6 @@ import {
|
|||||||
WidthCategory,
|
WidthCategory,
|
||||||
} from './host-window.service';
|
} from './host-window.service';
|
||||||
import { CSSVariableServiceStub } from './testing/css-variable-service.stub';
|
import { CSSVariableServiceStub } from './testing/css-variable-service.stub';
|
||||||
import { createMockStore } from '@ngrx/store/testing';
|
|
||||||
import { MockStore } from '@ngrx/store/testing/mock_store';
|
|
||||||
|
|
||||||
describe('HostWindowService', () => {
|
describe('HostWindowService', () => {
|
||||||
let service: HostWindowService;
|
let service: HostWindowService;
|
||||||
|
@@ -34,6 +34,7 @@ import { SectionsServiceStub } from '../../shared/testing/sections-service.stub'
|
|||||||
import { SubmissionJsonPatchOperationsServiceStub } from '../../shared/testing/submission-json-patch-operations-service.stub';
|
import { SubmissionJsonPatchOperationsServiceStub } from '../../shared/testing/submission-json-patch-operations-service.stub';
|
||||||
import { SubmissionServiceStub } from '../../shared/testing/submission-service.stub';
|
import { SubmissionServiceStub } from '../../shared/testing/submission-service.stub';
|
||||||
import { ThemeService } from '../../shared/theme-support/theme.service';
|
import { ThemeService } from '../../shared/theme-support/theme.service';
|
||||||
|
import { SubmissionFormComponent } from '../form/submission-form.component';
|
||||||
import { SectionsService } from '../sections/sections.service';
|
import { SectionsService } from '../sections/sections.service';
|
||||||
import { SubmissionService } from '../submission.service';
|
import { SubmissionService } from '../submission.service';
|
||||||
import { SubmissionEditComponent } from './submission-edit.component';
|
import { SubmissionEditComponent } from './submission-edit.component';
|
||||||
@@ -76,7 +77,6 @@ describe('SubmissionEditComponent Component', () => {
|
|||||||
{ provide: SubmissionService, useClass: SubmissionServiceStub },
|
{ provide: SubmissionService, useClass: SubmissionServiceStub },
|
||||||
{ provide: SubmissionJsonPatchOperationsService, useClass: SubmissionJsonPatchOperationsServiceStub },
|
{ provide: SubmissionJsonPatchOperationsService, useClass: SubmissionJsonPatchOperationsServiceStub },
|
||||||
{ provide: ItemDataService, useValue: itemDataService },
|
{ provide: ItemDataService, useValue: itemDataService },
|
||||||
// { provide: TranslateService, useValue: getMockTranslateService() },
|
|
||||||
{ provide: Router, useValue: new RouterStub() },
|
{ provide: Router, useValue: new RouterStub() },
|
||||||
{ provide: ActivatedRoute, useValue: route },
|
{ provide: ActivatedRoute, useValue: route },
|
||||||
{ provide: AuthService, useValue: new AuthServiceStub() },
|
{ provide: AuthService, useValue: new AuthServiceStub() },
|
||||||
@@ -87,6 +87,10 @@ describe('SubmissionEditComponent Component', () => {
|
|||||||
provideMockStore(),
|
provideMockStore(),
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
|
}).overrideComponent(SubmissionEditComponent, {
|
||||||
|
remove: {
|
||||||
|
imports: [ SubmissionFormComponent ],
|
||||||
|
},
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user