mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-12 20:43:08 +00:00
Added tests
This commit is contained in:
@@ -22,11 +22,7 @@ describe('JsonPatchOperationsEffects test suite', () => {
|
|||||||
const testJsonPatchResourceType = 'testResourceType';
|
const testJsonPatchResourceType = 'testResourceType';
|
||||||
const testJsonPatchResourceId = 'testResourceId';
|
const testJsonPatchResourceId = 'testResourceId';
|
||||||
|
|
||||||
function init() {
|
|
||||||
}
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
init();
|
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
providers: [
|
providers: [
|
||||||
JsonPatchOperationsEffects,
|
JsonPatchOperationsEffects,
|
||||||
|
@@ -0,0 +1,40 @@
|
|||||||
|
import { Store } from '@ngrx/store';
|
||||||
|
|
||||||
|
import { getTestScheduler } from 'jasmine-marbles';
|
||||||
|
import { TestScheduler } from 'rxjs/testing';
|
||||||
|
|
||||||
|
import { ResponseCacheService } from '../cache/response-cache.service';
|
||||||
|
import { CoreState } from '../core.reducers';
|
||||||
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
|
import { SubmissionJsonPatchOperationsService } from './submission-json-patch-operations.service';
|
||||||
|
import { RequestService } from '../data/request.service';
|
||||||
|
import { SubmissionPatchRequest } from '../data/request.models';
|
||||||
|
|
||||||
|
describe('SubmissionJsonPatchOperationsService', () => {
|
||||||
|
let scheduler: TestScheduler;
|
||||||
|
let service: SubmissionJsonPatchOperationsService;
|
||||||
|
const requestService = {} as RequestService;
|
||||||
|
const responseCache = {} as ResponseCacheService;
|
||||||
|
const store = {} as Store<CoreState>;
|
||||||
|
const halEndpointService = {} as HALEndpointService;
|
||||||
|
|
||||||
|
function initTestService() {
|
||||||
|
return new SubmissionJsonPatchOperationsService(
|
||||||
|
responseCache,
|
||||||
|
requestService,
|
||||||
|
store,
|
||||||
|
halEndpointService
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
scheduler = getTestScheduler();
|
||||||
|
service = initTestService();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should instantiate SubmissionJsonPatchOperationsService properly', () => {
|
||||||
|
expect(service).toBeDefined();
|
||||||
|
expect((service as any).patchRequestConstructor).toEqual(SubmissionPatchRequest);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
Reference in New Issue
Block a user