[ADF-2438] fixed thumbnails height (#3407)

* [ADF-2438] calculate thumbnail height

* [ADF-2438] send height to parent element

* [ADF-2438] add width to css

* [ADF-2438] moved height and width logic to parent component

* [ADF-2438] added height and width logic to parent component

* [ADF-2438] fixed failing test
This commit is contained in:
Georgiana Roman
2018-06-04 14:20:20 +03:00
committed by Eugenio Romano
parent 2f51b9f2b8
commit 1266acc4ab
6 changed files with 42 additions and 28 deletions

View File

@@ -32,11 +32,7 @@ describe('PdfThumbListComponent', () => {
const page = (id) => {
return {
id,
getPage: () => Promise.resolve({
getViewport: () => {
return 1;
}
})
getPage: Promise.resolve()
};
};
@@ -51,12 +47,8 @@ describe('PdfThumbListComponent', () => {
},
pdfDocument: {
getPage: (pageNum) => Promise.resolve({
getViewport: () => {
return 1;
},
render: () => {
return Promise.resolve({});
}
getViewport: () => ({ height: 421, width: 335 }),
render: jasmine.createSpy('render').and.returnValue(Promise.resolve())
})
},
_pages: [
@@ -78,7 +70,6 @@ describe('PdfThumbListComponent', () => {
beforeEach(async(() => {
fixture = TestBed.createComponent(PdfThumbListComponent);
component = fixture.componentInstance;
component.pdfViewer = viewerMock;
// provide scrollable container
@@ -100,6 +91,7 @@ describe('PdfThumbListComponent', () => {
});
it('should render next range on scroll', () => {
component.currentHeight = 114;
fixture.nativeElement.scrollTop = 700;
fixture.detectChanges();