68405: More test fixes

This commit is contained in:
Marie Verdonck
2020-01-30 19:18:56 +01:00
committed by Art Lowel
parent fb153b7b13
commit be0158fc9c
15 changed files with 395 additions and 221 deletions

View File

@@ -26,14 +26,22 @@ describe('GridThumbnailComponent', () => {
});
it('should display image', () => {
comp.thumbnail = new Bitstream();
comp.thumbnail._links.content.href = 'test.url';
const thumbnail = new Bitstream();
thumbnail._links = {
self: { href: 'self.url' },
bundle: { href: 'bundle.url' },
format: { href: 'format.url' },
content: { href: 'content.url' },
};
comp.thumbnail = thumbnail;
fixture.detectChanges();
const image: HTMLElement = de.query(By.css('img')).nativeElement;
expect(image.getAttribute('src')).toBe(comp.thumbnail._links.content.href);
});
it('should display placeholder', () => {
const thumbnail = new Bitstream();
comp.thumbnail = thumbnail;
fixture.detectChanges();
const image: HTMLElement = de.query(By.css('img')).nativeElement;
expect(image.getAttribute('src')).toBe(comp.defaultImage);