mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2388, ADF-2375] PDF Viewer - show buffer thumbnail on pagechange (#3011)
* disable thumbnails button until document is loaded * show buffer thumbnail on page change * correct value property * correct test
This commit is contained in:
committed by
Denys Vuika
parent
8f63af1fbd
commit
69ac38713f
@@ -437,4 +437,56 @@ describe('Test PdfViewer component', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('Viewer events', () => {
|
||||
beforeEach(() => {
|
||||
component.urlFile = require('../assets/fake-test-file.pdf');
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should emit pagechange event', (done) => {
|
||||
component.ngOnChanges(null).then(() => {
|
||||
fixture.detectChanges();
|
||||
return fixture.whenStable().then(() => {
|
||||
expect(component.displayPage).toBe(1);
|
||||
|
||||
const args = {
|
||||
pageNumber: 6,
|
||||
source: {
|
||||
container: component.documentContainer
|
||||
}
|
||||
};
|
||||
|
||||
component.pdfViewer.eventBus.dispatch('pagechange', args);
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(component.displayPage).toBe(6);
|
||||
expect(component.page).toBe(6);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should emit pagesloaded event', (done) => {
|
||||
component.ngOnChanges(null).then(() => {
|
||||
fixture.detectChanges();
|
||||
return fixture.whenStable().then(() => {
|
||||
expect(component.isPanelDisabled).toBe(true);
|
||||
|
||||
const args = {
|
||||
pagesCount: 10,
|
||||
source: {
|
||||
container: component.documentContainer
|
||||
}
|
||||
};
|
||||
|
||||
component.pdfViewer.eventBus.dispatch('pagesloaded', args);
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(component.isPanelDisabled).toBe(false);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user