Merge branch 'develop' into mochawesome

This commit is contained in:
John McLear 2021-02-03 11:23:54 +00:00 committed by GitHub
commit 7630e71957
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
75 changed files with 1347 additions and 1020 deletions

View file

@ -86,16 +86,16 @@ describe('drag and drop', function () {
const TARGET_LINE = 2;
const FIRST_SOURCE_LINE = 5;
const getLine = function (lineNumber) {
const getLine = (lineNumber) => {
const $lines = helper.padInner$('div');
return $lines.slice(lineNumber, lineNumber + 1);
};
const createScriptWithSeveralLines = function (done) {
const createScriptWithSeveralLines = (done) => {
// create some lines to be used on the tests
const $firstLine = helper.padInner$('div').first();
$firstLine.html(
'...<br>...<br>Target line []<br>...<br>...<br>Source line 1.<br>Source line 2.<br>');
$firstLine.html('...<br>...<br>Target line []<br>...<br>...<br>' +
'Source line 1.<br>Source line 2.<br>');
// wait for lines to be split
helper.waitFor(() => {
@ -104,7 +104,7 @@ describe('drag and drop', function () {
}).done(done);
};
const selectPartOfSourceLine = function () {
const selectPartOfSourceLine = () => {
const $sourceLine = getLine(FIRST_SOURCE_LINE);
// select 'line 1' from 'Source line 1.'
@ -112,14 +112,14 @@ describe('drag and drop', function () {
const end = start + 'line 1'.length;
helper.selectLines($sourceLine, $sourceLine, start, end);
};
const selectMultipleSourceLines = function () {
const selectMultipleSourceLines = () => {
const $firstSourceLine = getLine(FIRST_SOURCE_LINE);
const $lastSourceLine = getLine(FIRST_SOURCE_LINE + 1);
helper.selectLines($firstSourceLine, $lastSourceLine);
};
const dragSelectedTextAndDropItIntoMiddleOfLine = function (targetLineNumber) {
const dragSelectedTextAndDropItIntoMiddleOfLine = (targetLineNumber) => {
// dragstart: start dragging content
triggerEvent('dragstart');
@ -132,7 +132,7 @@ describe('drag and drop', function () {
triggerEvent('dragend');
};
const getHtmlFromSelectedText = function () {
const getHtmlFromSelectedText = () => {
const innerDocument = helper.padInner$.document;
const range = innerDocument.getSelection().getRangeAt(0);
@ -145,12 +145,12 @@ describe('drag and drop', function () {
return draggedHtml;
};
const triggerEvent = function (eventName) {
const event = helper.padInner$.Event(eventName);
const triggerEvent = (eventName) => {
const event = new helper.padInner$.Event(eventName);
helper.padInner$('#innerdocbody').trigger(event);
};
const moveSelectionIntoTarget = function (draggedHtml, targetLineNumber) {
const moveSelectionIntoTarget = (draggedHtml, targetLineNumber) => {
const innerDocument = helper.padInner$.document;
// delete original content