mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
low hanging lint and some hard coded timeouts
This commit is contained in:
parent
809670dbea
commit
edf1dabe65
36 changed files with 273 additions and 150 deletions
|
@ -1,3 +1,5 @@
|
|||
'use strict';
|
||||
|
||||
describe('enter keystroke', function () {
|
||||
// create a new pad before each test run
|
||||
beforeEach(function (cb) {
|
||||
|
@ -6,8 +8,9 @@ describe('enter keystroke', function () {
|
|||
});
|
||||
|
||||
it('creates a new line & puts cursor onto a new line', function (done) {
|
||||
this.timeout(2000);
|
||||
|
||||
const inner$ = helper.padInner$;
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
// get the first text element out of the inner iframe
|
||||
const $firstTextElement = inner$('div').first();
|
||||
|
@ -18,14 +21,12 @@ describe('enter keystroke', function () {
|
|||
// simulate key presses to enter content
|
||||
$firstTextElement.sendkeys('{enter}');
|
||||
|
||||
// ace creates a new dom element when you press a keystroke, so just get the first text element again
|
||||
const $newFirstTextElement = inner$('div').first();
|
||||
|
||||
helper.waitFor(() => inner$('div').first().text() === '').done(() => {
|
||||
const $newSecondLine = inner$('div').first().next();
|
||||
const newFirstTextElementValue = inner$('div').first().text();
|
||||
expect(newFirstTextElementValue).to.be(''); // expect the first line to be blank
|
||||
expect($newSecondLine.text()).to.be(originalTextValue); // expect the second line to be the same as the original first line.
|
||||
// expect the second line to be the same as the original first line.
|
||||
expect($newSecondLine.text()).to.be(originalTextValue);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue