Skip to content

Commit

Permalink
Fixed failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
milanmajchrak committed Dec 28, 2023
1 parent 9441038 commit 1c3223e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<ItemEditBitstreamComponent>;
Expand All @@ -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',
Expand All @@ -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,
Expand Down Expand Up @@ -82,7 +100,7 @@ describe('ItemEditBitstreamComponent', () => {
RouterLinkDirectiveStub
],
providers: [
{ provide: ObjectUpdatesService, useValue: objectUpdatesService }
{ provide: ObjectUpdatesService, useValue: objectUpdatesService },
], schemas: [
NO_ERRORS_SCHEMA
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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) {
}

Expand Down
3 changes: 2 additions & 1 deletion src/app/thumbnail/thumbnail.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@ describe('ThumbnailComponent', () => {
bundle: { href: 'bundle.url' },
format: { href: 'format.url' },
content: { href: CONTENT },
thumbnail: undefined
thumbnail: undefined,
checksum: undefined
};
});

Expand Down

0 comments on commit 1c3223e

Please sign in to comment.