mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Page Number doesn't change when user scroll the document #319
This commit is contained in:
@@ -346,8 +346,7 @@ describe('PdfViewer', () => {
|
||||
}));
|
||||
});
|
||||
|
||||
describe('Rezize interaction', () => {
|
||||
|
||||
describe('Resize interaction', () => {
|
||||
it('resize event should trigger setScaleUpdatePages', inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
|
||||
return tcb
|
||||
.createAsync(PdfViewerComponent)
|
||||
@@ -370,4 +369,33 @@ describe('PdfViewer', () => {
|
||||
}));
|
||||
});
|
||||
|
||||
describe('scroll interaction', () => {
|
||||
it('scroll page should return the current page', inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
|
||||
return tcb
|
||||
.createAsync(PdfViewerComponent)
|
||||
.then((fixture) => {
|
||||
let component = fixture.componentInstance;
|
||||
|
||||
spyOn(component, 'getPDFJS').and.returnValue(new PDFJSmock());
|
||||
spyOn(component, 'initPDFViewer').and.callFake(() => {
|
||||
component.pdfViewer = new PDFViewermock();
|
||||
});
|
||||
|
||||
component.urlFile = 'fake-url-file';
|
||||
|
||||
component.ngOnChanges().then(() => {
|
||||
fixture.detectChanges();
|
||||
expect(component.displayPage).toBe(1);
|
||||
component.inputPage('4');
|
||||
fixture.detectChanges();
|
||||
expect(component.displayPage).toBe(4);
|
||||
component.watchScroll({scrollTop: 10000});
|
||||
expect(component.displayPage).toBe(4);
|
||||
}).catch((error) => {
|
||||
expect(error).toBeUndefined();
|
||||
});
|
||||
});
|
||||
}));
|
||||
});
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user