2021-03-17 06:51:04 +01:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
describe('height regression after ace.js refactoring', function () {
|
2021-03-31 21:14:02 -04:00
|
|
|
before(async function () {
|
|
|
|
await helper.aNewPad();
|
2021-03-17 06:51:04 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
// everything fits inside the viewport
|
2021-03-31 21:14:02 -04:00
|
|
|
it('clientHeight should equal scrollHeight with few lines', async function () {
|
2021-03-17 06:51:04 +01:00
|
|
|
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);
|
|
|
|
});
|
|
|
|
});
|