fix issue where iiif tests would fail

This commit is contained in:
Art Lowel
2023-06-08 15:44:30 +02:00
parent 56cba82c2d
commit c9324b0714
2 changed files with 15 additions and 10 deletions

View File

@@ -47,7 +47,7 @@ let bundle;
let comp: EditBitstreamPageComponent;
let fixture: ComponentFixture<EditBitstreamPageComponent>;
fdescribe('EditBitstreamPageComponent', () => {
describe('EditBitstreamPageComponent', () => {
beforeEach(() => {
bitstreamID = 'current-bitstream-id';
@@ -223,7 +223,7 @@ fdescribe('EditBitstreamPageComponent', () => {
spyOn(router, 'navigate');
});
fdescribe('on startup', () => {
describe('on startup', () => {
let rawForm;
beforeEach(() => {
@@ -454,13 +454,18 @@ fdescribe('EditBitstreamPageComponent', () => {
self: 'bitstream-selflink'
},
bundle: createSuccessfulRemoteDataObject$({
_links: {
primaryBitstream: {
href: 'bundle-selflink'
}
},
item: createSuccessfulRemoteDataObject$(Object.assign(new Item(), {
uuid: 'some-uuid',
firstMetadataValue(keyOrKeys: string | string[], valueFilter?: MetadataValueFilter): string {
return 'True';
}
}))
})
}),
});
bitstreamService = jasmine.createSpyObj('bitstreamService', {
findById: createSuccessfulRemoteDataObject$(bitstream),
@@ -574,16 +579,22 @@ fdescribe('EditBitstreamPageComponent', () => {
self: 'bitstream-selflink'
},
bundle: createSuccessfulRemoteDataObject$({
_links: {
primaryBitstream: {
href: 'bundle-selflink'
}
},
item: createSuccessfulRemoteDataObject$(Object.assign(new Item(), {
uuid: 'some-uuid',
firstMetadataValue(keyOrKeys: string | string[], valueFilter?: MetadataValueFilter): string {
return 'True';
}
}))
})
}),
});
bitstreamService = jasmine.createSpyObj('bitstreamService', {
findById: createSuccessfulRemoteDataObject$(bitstream),
findByHref: createSuccessfulRemoteDataObject$(bitstream),
update: createSuccessfulRemoteDataObject$(bitstream),
updateFormat: createSuccessfulRemoteDataObject$(bitstream),
commitUpdates: {},

View File

@@ -401,33 +401,27 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
const bitstream$ = this.bitstreamRD$.pipe(
getFirstSucceededRemoteData(),
getRemoteDataPayload(),
tap(t => console.log(t)),
);
const allFormats$ = this.bitstreamFormatsRD$.pipe(
getFirstSucceededRemoteData(),
getRemoteDataPayload(),
tap(t => console.log(t)),
);
const bundle$ = bitstream$.pipe(
switchMap((bitstream: Bitstream) => bitstream.bundle),
getFirstSucceededRemoteDataPayload(),
tap(t => console.log(t)),
);
const primaryBitstream$ = bundle$.pipe(
hasValueOperator(),
tap(t => console.log(t._links.primaryBitstream.href)),
switchMap((bundle: Bundle) => this.bitstreamService.findByHref(bundle._links.primaryBitstream.href)),
getFirstSucceededRemoteDataPayload(),
tap(t => console.log(t)),
);
const item$ = bundle$.pipe(
switchMap((bundle: Bundle) => bundle.item),
getFirstSucceededRemoteDataPayload(),
tap(t => console.log(t)),
);
this.subs.push(
observableCombineLatest(