Merge branch 'w2p-88507_Fix-Download-Link-Edit-Bitstream-Page' into w2p-88507_Fix-Download-Link-Edit-Bitstream-Page_GitHub

This commit is contained in:
Jens Vannerum
2022-03-18 09:06:29 +01:00

View File

@@ -31,6 +31,10 @@ const bitstream = Object.assign(new Bitstream(), {
name: 'Fake Bitstream',
bundleName: 'ORIGINAL',
description: 'Description',
_links: {
content: { href: 'content-link' }
},
format: createSuccessfulRemoteDataObject$(format)
});
const fieldUpdate = {
@@ -120,10 +124,17 @@ describe('ItemEditBitstreamComponent', () => {
});
describe('when the component loads', () => {
it('the download button should contain the link to the bitstreams download page', () => {
it('should contain download button with a valid link to the bitstreams download page', () => {
fixture.detectChanges();
const downloadBtnHref = fixture.debugElement.query(By.css('[data-test="download-button"]')).nativeElement.getAttribute('href');
expect(downloadBtnHref).toEqual(comp.bitstreamDownloadUrl);
});
});
describe('when the bitstreamDownloadUrl property gets populated', () => {
it('should contain the bitstream download page route', () => {
expect(comp.bitstreamDownloadUrl).not.toEqual(bitstream._links.content.href);
expect(comp.bitstreamDownloadUrl).toEqual(getBitstreamDownloadRoute(bitstream));
});
});
});