mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
68346: Test fixes
This commit is contained in:
@@ -152,7 +152,7 @@ describe('EditBitstreamPageComponent', () => {
|
||||
});
|
||||
|
||||
it('should fill in the bitstream\'s description', () => {
|
||||
expect(rawForm.descriptionContainer.description).toEqual(bitstream.description);
|
||||
expect(rawForm.descriptionContainer.description).toEqual(bitstream.firstMetadataValue('dc.description'));
|
||||
});
|
||||
|
||||
it('should select the correct format', () => {
|
||||
|
@@ -275,9 +275,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
|
||||
private translate: TranslateService,
|
||||
private bitstreamService: BitstreamDataService,
|
||||
private notificationsService: NotificationsService,
|
||||
private bitstreamFormatService: BitstreamFormatDataService,
|
||||
private objectCache: ObjectCacheService,
|
||||
private requestService: RequestService) {
|
||||
private bitstreamFormatService: BitstreamFormatDataService) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -23,9 +23,8 @@ import { VarDirective } from '../../../shared/utils/var.directive';
|
||||
import { Bitstream } from '../../../core/shared/bitstream.model';
|
||||
import { BundleDataService } from '../../../core/data/bundle-data.service';
|
||||
import { Bundle } from '../../../core/shared/bundle.model';
|
||||
import { By } from '@angular/platform-browser';
|
||||
|
||||
fdescribe('UploadBistreamComponent', () => {
|
||||
describe('UploadBistreamComponent', () => {
|
||||
let comp: UploadBitstreamComponent;
|
||||
let fixture: ComponentFixture<UploadBitstreamComponent>;
|
||||
|
||||
|
@@ -146,7 +146,7 @@ describe('ItemBitstreamsComponent', () => {
|
||||
url: url
|
||||
});
|
||||
bundleService = jasmine.createSpyObj('bundleService', {
|
||||
immediatePatch: observableOf(new RestResponse(true, 200, 'OK'))
|
||||
patch: observableOf(new RestResponse(true, 200, 'OK'))
|
||||
});
|
||||
|
||||
TestBed.configureTestingModule({
|
||||
@@ -192,7 +192,7 @@ describe('ItemBitstreamsComponent', () => {
|
||||
});
|
||||
|
||||
it('should send out a patch for the move operations', () => {
|
||||
expect(bundleService.immediatePatch).toHaveBeenCalled();
|
||||
expect(bundleService.patch).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
|
@@ -287,18 +287,23 @@ describe('DataService', () => {
|
||||
});
|
||||
|
||||
describe('patch', () => {
|
||||
let operations;
|
||||
let selfLink;
|
||||
const dso = {
|
||||
uuid: 'dso-uuid'
|
||||
};
|
||||
const operations = [
|
||||
Object.assign({
|
||||
op: 'move',
|
||||
from: '/1',
|
||||
path: '/5'
|
||||
}) as Operation
|
||||
];
|
||||
|
||||
beforeEach(() => {
|
||||
operations = [{ op: 'replace', path: '/metadata/dc.title', value: 'random string' } as Operation];
|
||||
selfLink = 'https://rest.api/endpoint/1698f1d3-be98-4c51-9fd8-6bfedcbd59b7';
|
||||
spyOn(objectCache, 'addPatch');
|
||||
service.patch(dso, operations);
|
||||
});
|
||||
|
||||
it('should call addPatch on the object cache with the right parameters', () => {
|
||||
service.patch(selfLink, operations);
|
||||
expect(objectCache.addPatch).toHaveBeenCalledWith(selfLink, operations);
|
||||
it('should configure a PatchRequest', () => {
|
||||
expect(requestService.configure).toHaveBeenCalledWith(jasmine.any(PatchRequest));
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user