From 1c3223ef334648f300b5794466446ad615ae527a Mon Sep 17 00:00:00 2001 From: milanmajchrak Date: Thu, 28 Dec 2023 12:34:54 +0100 Subject: [PATCH] Fixed failing tests --- .../item-edit-bitstream.component.spec.ts | 22 +++++++++++++++++-- .../item-edit-bitstream.component.ts | 4 ---- src/app/thumbnail/thumbnail.component.spec.ts | 3 ++- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.spec.ts b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.spec.ts index ca9aff92e1a..fec8a62448a 100644 --- a/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.spec.ts @@ -14,6 +14,7 @@ import { getBitstreamDownloadRoute } from '../../../../app-routing-paths'; import { By } from '@angular/platform-browser'; import { BrowserOnlyMockPipe } from '../../../../shared/testing/browser-only-mock.pipe'; import { RouterLinkDirectiveStub } from '../../../../shared/testing/router-link-directive.stub'; +import { BitstreamChecksum } from '../../../../core/shared/bitstream-checksum.model'; let comp: ItemEditBitstreamComponent; let fixture: ComponentFixture; @@ -29,6 +30,22 @@ const columnSizes = new ResponsiveTableSizes([ const format = Object.assign(new BitstreamFormat(), { shortDescription: 'PDF' }); + +const checksum = Object.assign(new BitstreamChecksum(), { + activeStore: { + checkSumAlgorithm: 'MD5', + value: '123' + }, + synchronizedStore: { + checkSumAlgorithm: 'MD5', + value: '456' + }, + databaseChecksum: { + checkSumAlgorithm: 'MD5', + value: '789' + } +}); + const bitstream = Object.assign(new Bitstream(), { uuid: 'bitstreamUUID', name: 'Fake Bitstream', @@ -38,7 +55,8 @@ const bitstream = Object.assign(new Bitstream(), { content: { href: 'content-link' } }, - format: createSuccessfulRemoteDataObject$(format) + format: createSuccessfulRemoteDataObject$(format), + checksum: createSuccessfulRemoteDataObject$(checksum) }); const fieldUpdate = { field: bitstream, @@ -82,7 +100,7 @@ describe('ItemEditBitstreamComponent', () => { RouterLinkDirectiveStub ], providers: [ - { provide: ObjectUpdatesService, useValue: objectUpdatesService } + { provide: ObjectUpdatesService, useValue: objectUpdatesService }, ], schemas: [ NO_ERRORS_SCHEMA ] diff --git a/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.ts b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.ts index d9c61afabc0..a4c81901304 100644 --- a/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.ts +++ b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.ts @@ -14,8 +14,6 @@ import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { FieldUpdate } from '../../../../core/data/object-updates/field-update.model'; import { FieldChangeType } from '../../../../core/data/object-updates/field-change-type.model'; import { getBitstreamDownloadRoute } from '../../../../app-routing-paths'; -import { RequestService } from '../../../../core/data/request.service'; -import { RemoteDataBuildService } from '../../../../core/cache/builders/remote-data-build.service'; import { BitstreamChecksum, CheckSum } from '../../../../core/shared/bitstream-checksum.model'; @Component({ @@ -82,8 +80,6 @@ export class ItemEditBitstreamComponent implements OnChanges, OnInit { constructor(private objectUpdatesService: ObjectUpdatesService, private dsoNameService: DSONameService, - protected requestService: RequestService, - protected rdbService: RemoteDataBuildService, private viewContainerRef: ViewContainerRef) { } diff --git a/src/app/thumbnail/thumbnail.component.spec.ts b/src/app/thumbnail/thumbnail.component.spec.ts index 29aebe03fc2..1f9fa6caed4 100644 --- a/src/app/thumbnail/thumbnail.component.spec.ts +++ b/src/app/thumbnail/thumbnail.component.spec.ts @@ -290,7 +290,8 @@ describe('ThumbnailComponent', () => { bundle: { href: 'bundle.url' }, format: { href: 'format.url' }, content: { href: CONTENT }, - thumbnail: undefined + thumbnail: undefined, + checksum: undefined }; });