diff --git a/src/app/+bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts b/src/app/+bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts index d7349894a9..d35f2d5c21 100644 --- a/src/app/+bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts +++ b/src/app/+bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts @@ -239,17 +239,17 @@ describe('EditBitstreamPageComponent', () => { }); }); describe('when navigateToItemEditBitstreams is called, and the component has an itemId', () => { - it('should redirect to the item edit path bitstream page', () => { - comp.itemId = 'some-uuid' + it('should redirect to the item edit page on the bitstreams tab with the itemId from the component', () => { + comp.itemId = 'some-uuid1' + comp.navigateToItemEditBitstreams(); + expect(routerStub.navigate).toHaveBeenCalledWith([getItemEditRoute('some-uuid1'), 'bitstreams']); + }); + }); + describe('when navigateToItemEditBitstreams is called, and the component does not have an itemId', () => { + it('should redirect to the item edit page on the bitstreams tab with the itemId from the bundle links ', () => { + comp.itemId = undefined; comp.navigateToItemEditBitstreams(); expect(routerStub.navigate).toHaveBeenCalledWith([getItemEditRoute('some-uuid'), 'bitstreams']); }); }); - describe('when navigateToItemEditBitstreams is called, and the component does not have an itemId', () => { - it('should redirect to the item page', () => { - comp.itemId = undefined; - comp.navigateToItemEditBitstreams(); - expect(routerStub.navigate).toHaveBeenCalledWith([getItemPageRoute('some-uuid')]); - }); - }); }); diff --git a/src/app/+bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts b/src/app/+bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts index 7f002478fe..a8bb321087 100644 --- a/src/app/+bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts +++ b/src/app/+bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts @@ -507,7 +507,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy { this.bitstream.bundle.pipe(getFirstSucceededRemoteDataPayload(), mergeMap((bundle: Bundle) => bundle.item.pipe(getFirstSucceededRemoteDataPayload(), map((item: Item) => item.uuid)))) .subscribe((item) => { - this.router.navigate(([getItemPageRoute(item)])); + this.router.navigate(([getItemEditRoute(item), 'bitstreams'])); }); } }