add test for wrong clientHeight
This commit is contained in:
parent
3ad1d0a74f
commit
b250ceaae7
1 changed files with 31 additions and 0 deletions
31
src/tests/frontend/specs/inner_height.js
Normal file
31
src/tests/frontend/specs/inner_height.js
Normal file
|
@ -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);
|
||||
});
|
||||
});
|
Loading…
Reference in a new issue