mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 00:46:16 -04:00
Low hanging lint frontend tests (#4695)
* lint: low hanging specs/alphabet.js * lint: low hanging specs/authorship_of_editions.js * lint: low hanging specs/bold.js * lint: low hanging specs/caret.js * lint: low hanging specs/change_user_color.js * lint: low hanging specs/change_user_name.js * lint: low hanging specs/chat.js * lint: low hanging specs/chat_load_messages.js * lint: low hanging specs/clear_authorship_colors.js * lint: low hanging specs/delete.js * lint: low hanging specs/drag_and_drop.js * lint: low hanging specs/embed_value.js * lint: low hanging specs/enter.js * lint: low hanging specs/font_type.js * lint: low hanging specs/helper.js * lint: low hanging specs/importexport.js * lint: low hanging specs/importindents.js * lint: low hanging specs/indentation.js * lint: low hanging specs/italic.js * lint: low hanging specs/language.js * lint: low hanging specs/multiple_authors_clear_authorship_colors.js * lint: low hanging specs/ordered_list.js * lint: low hanging specs/pad_modal.js * lint: low hanging specs/redo.js * lint: low hanging specs/responsiveness.js * lint: low hanging specs/select_formatting_buttons.js * lint: low hanging specs/strikethrough.js * lint: low hanging specs/timeslider.js * lint: low hanging specs/timeslider_labels.js * lint: low hanging specs/timeslider_numeric_padID.js * lint: low hanging specs/timeslider_revisions.js * lint: low hanging specs/undo.js * lint: low hanging specs/unordered_list.js * lint: low hanging specs/xxauto_reconnect.js * lint: attempt to do remote_runner.js * lint: helper linting * lint: rate limit linting * use constructor for Event to make eslint happier * for squash: lint fix refinements * for squash: lint fix refinements Co-authored-by: Richard Hansen <rhansen@rhansen.org>
This commit is contained in:
parent
759e2aaec3
commit
915849b319
39 changed files with 595 additions and 357 deletions
|
@ -1,3 +1,5 @@
|
|||
'use strict';
|
||||
|
||||
describe('assign ordered list', function () {
|
||||
// create a new pad before each test run
|
||||
beforeEach(function (cb) {
|
||||
|
@ -34,7 +36,8 @@ describe('assign ordered list', function () {
|
|||
});
|
||||
|
||||
it('does not insert unordered list', function (done) {
|
||||
helper.waitFor(() => helper.padInner$('div').first().find('ol li').length === 1).done(() => {
|
||||
helper.waitFor(
|
||||
() => helper.padInner$('div').first().find('ol li').length === 1).done(() => {
|
||||
expect().fail(() => 'Unordered list inserted, should ignore shortcut');
|
||||
}).fail(() => {
|
||||
done();
|
||||
|
@ -62,7 +65,8 @@ describe('assign ordered list', function () {
|
|||
});
|
||||
|
||||
it('does not insert unordered list', function (done) {
|
||||
helper.waitFor(() => helper.padInner$('div').first().find('ol li').length === 1).done(() => {
|
||||
helper.waitFor(
|
||||
() => helper.padInner$('div').first().find('ol li').length === 1).done(() => {
|
||||
expect().fail(() => 'Unordered list inserted, should ignore shortcut');
|
||||
}).fail(() => {
|
||||
done();
|
||||
|
@ -71,7 +75,8 @@ describe('assign ordered list', function () {
|
|||
});
|
||||
});
|
||||
|
||||
xit('issue #1125 keeps the numbered list on enter for the new line - EMULATES PASTING INTO A PAD', function (done) {
|
||||
xit('issue #1125 keeps the numbered list on enter for the new line', function (done) {
|
||||
// EMULATES PASTING INTO A PAD
|
||||
const inner$ = helper.padInner$;
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
|
@ -91,24 +96,25 @@ describe('assign ordered list', function () {
|
|||
expect(hasOLElement).to.be(true);
|
||||
expect($newSecondLine.text()).to.be('line 2');
|
||||
const hasLineNumber = $newSecondLine.find('ol').attr('start') === 2;
|
||||
expect(hasLineNumber).to.be(true); // This doesn't work because pasting in content doesn't work
|
||||
// This doesn't work because pasting in content doesn't work
|
||||
expect(hasLineNumber).to.be(true);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
var triggerCtrlShiftShortcut = function (shortcutChar) {
|
||||
const triggerCtrlShiftShortcut = (shortcutChar) => {
|
||||
const inner$ = helper.padInner$;
|
||||
const e = inner$.Event(helper.evtType);
|
||||
const e = new inner$.Event(helper.evtType);
|
||||
e.ctrlKey = true;
|
||||
e.shiftKey = true;
|
||||
e.which = shortcutChar.toString().charCodeAt(0);
|
||||
inner$('#innerdocbody').trigger(e);
|
||||
};
|
||||
|
||||
var makeSureShortcutIsDisabled = function (shortcut) {
|
||||
const makeSureShortcutIsDisabled = (shortcut) => {
|
||||
helper.padChrome$.window.clientVars.padShortcutEnabled[shortcut] = false;
|
||||
};
|
||||
var makeSureShortcutIsEnabled = function (shortcut) {
|
||||
const makeSureShortcutIsEnabled = (shortcut) => {
|
||||
helper.padChrome$.window.clientVars.padShortcutEnabled[shortcut] = true;
|
||||
};
|
||||
});
|
||||
|
@ -133,7 +139,7 @@ describe('Pressing Tab in an OL increases and decreases indentation', function (
|
|||
const $insertorderedlistButton = chrome$('.buttonicon-insertorderedlist');
|
||||
$insertorderedlistButton.click();
|
||||
|
||||
const e = inner$.Event(helper.evtType);
|
||||
const e = new inner$.Event(helper.evtType);
|
||||
e.keyCode = 9; // tab
|
||||
inner$('#innerdocbody').trigger(e);
|
||||
|
||||
|
@ -147,7 +153,8 @@ describe('Pressing Tab in an OL increases and decreases indentation', function (
|
|||
});
|
||||
|
||||
|
||||
describe('Pressing indent/outdent button in an OL increases and decreases indentation and bullet / ol formatting', function () {
|
||||
describe('Pressing indent/outdent button in an OL increases and ' +
|
||||
'decreases indentation and bullet / ol formatting', function () {
|
||||
// create a new pad before each test run
|
||||
beforeEach(function (cb) {
|
||||
helper.newPad(cb);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue