diff --git a/src/tests/frontend/specs/inner_height.js b/src/tests/frontend/specs/inner_height.js new file mode 100644 index 00000000..526aba88 --- /dev/null +++ b/src/tests/frontend/specs/inner_height.js @@ -0,0 +1,31 @@ +'use strict'; + +describe('height regression after ace.js refactoring', function () { + before(function (cb) { + helper.newPad(cb); + }); + + // everything fits inside the viewport + it('clientHeight should equal scrollHeight with few lines', function() { + const aceOuter = helper.padChrome$('iframe')[0].contentDocument; + const clientHeight = aceOuter.documentElement.clientHeight; + const scrollHeight = aceOuter.documentElement.scrollHeight; + expect(clientHeight).to.be(scrollHeight); + }); + + it('client height should be less than scrollHeight with many lines', async function () { + await helper.clearPad(); + await helper.edit('Test line\n' + + '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n' + + '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n' + + '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n' + + '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n' + + '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n' + + '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n' + + '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n'); + const aceOuter = helper.padChrome$('iframe')[0].contentDocument; + const clientHeight = aceOuter.documentElement.clientHeight; + const scrollHeight = aceOuter.documentElement.scrollHeight; + expect(clientHeight).to.be.lessThan(scrollHeight); + }); +});