diff --git a/src/lib/viewers/doc/PresentationViewer.js b/src/lib/viewers/doc/PresentationViewer.js index d8f962f66..277760cec 100644 --- a/src/lib/viewers/doc/PresentationViewer.js +++ b/src/lib/viewers/doc/PresentationViewer.js @@ -85,7 +85,7 @@ class PresentationViewer extends DocBaseViewer { * @param {string} key - Keydown key * @return {boolean} Consumed or not */ - onKeydown(key) { + onKeydown(key, event) { if (key === 'ArrowUp') { this.previousPage(); return true; @@ -94,7 +94,7 @@ class PresentationViewer extends DocBaseViewer { return true; } - return super.onKeydown(key); + return super.onKeydown(key, event); } /** diff --git a/src/lib/viewers/doc/__tests__/PresentationViewer-test.js b/src/lib/viewers/doc/__tests__/PresentationViewer-test.js index d1d0e991a..7f1995115 100644 --- a/src/lib/viewers/doc/__tests__/PresentationViewer-test.js +++ b/src/lib/viewers/doc/__tests__/PresentationViewer-test.js @@ -177,8 +177,14 @@ describe('lib/viewers/doc/PresentationViewer', () => { }); it('should fallback to doc base\'s onKeydown if no entry matches', () => { - const result = presentation.onKeydown('ArrowRight'); + const docBaseSpy = sandbox.spy(DocBaseViewer.prototype, 'onKeydown'); + const eventStub = sandbox.stub(); + const key = 'ArrowRight'; + + const result = presentation.onKeydown(key, eventStub); + + expect(docBaseSpy).to.have.been.calledWithExactly(key, eventStub); expect(result).to.be.true; expect(stubs.nextPage).to.be.called;