mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
side div line number alignment
This commit is contained in:
parent
f24353e806
commit
f109115017
1 changed files with 35 additions and 0 deletions
35
src/tests/frontend/specs/line_numbers.js
Normal file
35
src/tests/frontend/specs/line_numbers.js
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
describe('Side Div Line Numbers', function () {
|
||||||
|
// create a new pad before each test run
|
||||||
|
beforeEach(function (cb) {
|
||||||
|
helper.newPad(cb);
|
||||||
|
this.timeout(60000);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('numbers line up with content', async () => {
|
||||||
|
this.timeout(100);
|
||||||
|
const inner$ = helper.padInner$;
|
||||||
|
|
||||||
|
// get the first text element out of the inner iframe
|
||||||
|
const $firstLine = inner$('div').first();
|
||||||
|
|
||||||
|
// select this text element
|
||||||
|
let i = 0;
|
||||||
|
while (i < 40) {
|
||||||
|
$firstLine
|
||||||
|
.sendkeys('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789');
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
const $firstLineNumber = helper.padOuter$('#sidedivinner').children().first("div");
|
||||||
|
const $secondLine = $firstLine.next();
|
||||||
|
await helper.waitForPromise(
|
||||||
|
() => helper.padOuter$('#sidedivinner').children('div').first().next().text() === "2"
|
||||||
|
)
|
||||||
|
const $secondLineNumber = $firstLineNumber.next();
|
||||||
|
expect($firstLine.offset().top).to.be.below($firstLineNumber.offset().top);
|
||||||
|
expect($secondLine.offset().top).to.be.below($secondLineNumber.offset().top);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
Loading…
Reference in a new issue