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('import functionality', function () {
|
||||
beforeEach(function (cb) {
|
||||
helper.newPad(cb); // creates a new pad
|
||||
|
@ -16,7 +18,6 @@ describe('import functionality', function () {
|
|||
return newtext;
|
||||
}
|
||||
function importrequest(data, importurl, type) {
|
||||
let success;
|
||||
let error;
|
||||
const result = $.ajax({
|
||||
url: importurl,
|
||||
|
@ -27,7 +28,17 @@ describe('import functionality', function () {
|
|||
accepts: {
|
||||
text: 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
||||
},
|
||||
data: `Content-Type: multipart/form-data; boundary=--boundary\r\n\r\n--boundary\r\nContent-Disposition: form-data; name="file"; filename="import.${type}"\r\nContent-Type: text/plain\r\n\r\n${data}\r\n\r\n--boundary`,
|
||||
data: [
|
||||
'Content-Type: multipart/form-data; boundary=--boundary',
|
||||
'',
|
||||
'--boundary',
|
||||
`Content-Disposition: form-data; name="file"; filename="import.${type}"`,
|
||||
'Content-Type: text/plain',
|
||||
'',
|
||||
data,
|
||||
'',
|
||||
'--boundary',
|
||||
].join('\r\n'),
|
||||
error(res) {
|
||||
error = res;
|
||||
},
|
||||
|
@ -56,7 +67,8 @@ describe('import functionality', function () {
|
|||
const importurl = `${helper.padChrome$.window.location.href}/import`;
|
||||
const textWithNewLines = 'imported text\nnewline';
|
||||
importrequest(textWithNewLines, importurl, 'txt');
|
||||
helper.waitFor(() => expect(getinnertext()).to.be('<span class="">imported text</span>\n<span class="">newline</span>\n<br>\n'));
|
||||
helper.waitFor(() => expect(getinnertext())
|
||||
.to.be('<span class="">imported text</span>\n<span class="">newline</span>\n<br>\n'));
|
||||
const results = exportfunc(helper.padChrome$.window.location.href);
|
||||
expect(results[0][1]).to.be('imported text<br>newline<br><br>');
|
||||
expect(results[1][1]).to.be('imported text\nnewline\n\n');
|
||||
|
@ -66,7 +78,8 @@ describe('import functionality', function () {
|
|||
const importurl = `${helper.padChrome$.window.location.href}/import`;
|
||||
const htmlWithNewLines = '<html><body>htmltext<br/>newline</body></html>';
|
||||
importrequest(htmlWithNewLines, importurl, 'html');
|
||||
helper.waitFor(() => expect(getinnertext()).to.be('<span class="">htmltext</span>\n<span class="">newline</span>\n<br>\n'));
|
||||
helper.waitFor(() => expect(getinnertext())
|
||||
.to.be('<span class="">htmltext</span>\n<span class="">newline</span>\n<br>\n'));
|
||||
const results = exportfunc(helper.padChrome$.window.location.href);
|
||||
expect(results[0][1]).to.be('htmltext<br>newline<br><br>');
|
||||
expect(results[1][1]).to.be('htmltext\nnewline\n\n');
|
||||
|
@ -74,69 +87,109 @@ describe('import functionality', function () {
|
|||
});
|
||||
xit('import a pad with attributes from html', function (done) {
|
||||
const importurl = `${helper.padChrome$.window.location.href}/import`;
|
||||
const htmlWithNewLines = '<html><body>htmltext<br/><span class="b s i u"><b><i><s><u>newline</u></s></i></b></body></html>';
|
||||
const htmlWithNewLines = '<html><body>htmltext<br/><span class="b s i u">' +
|
||||
'<b><i><s><u>newline</u></s></i></b></body></html>';
|
||||
importrequest(htmlWithNewLines, importurl, 'html');
|
||||
helper.waitFor(() => expect(getinnertext()).to.be('<span class="">htmltext</span>\n<span class="b i s u"><b><i><s><u>newline</u></s></i></b></span>\n<br>\n'));
|
||||
helper.waitFor(() => expect(getinnertext())
|
||||
.to.be('<span class="">htmltext</span>\n<span class="b i s u">' +
|
||||
'<b><i><s><u>newline</u></s></i></b></span>\n<br>\n'));
|
||||
const results = exportfunc(helper.padChrome$.window.location.href);
|
||||
expect(results[0][1]).to.be('htmltext<br><strong><em><s><u>newline</u></s></em></strong><br><br>');
|
||||
expect(results[0][1])
|
||||
.to.be('htmltext<br><strong><em><s><u>newline</u></s></em></strong><br><br>');
|
||||
expect(results[1][1]).to.be('htmltext\nnewline\n\n');
|
||||
done();
|
||||
});
|
||||
xit('import a pad with bullets from html', function (done) {
|
||||
const importurl = `${helper.padChrome$.window.location.href}/import`;
|
||||
const htmlWithBullets = '<html><body><ul class="list-bullet1"><li>bullet line 1</li><li>bullet line 2</li><ul class="list-bullet2"><li>bullet2 line 1</li><li>bullet2 line 2</li></ul></ul></body></html>';
|
||||
const htmlWithBullets = '<html><body><ul class="list-bullet1"><li>bullet line 1</li>' +
|
||||
'<li>bullet line 2</li><ul class="list-bullet2"><li>bullet2 line 1</li>' +
|
||||
'<li>bullet2 line 2</li></ul></ul></body></html>';
|
||||
importrequest(htmlWithBullets, importurl, 'html');
|
||||
helper.waitFor(() => expect(getinnertext()).to.be('\
|
||||
<ul class="list-bullet1"><li><span class="">bullet line 1</span></li></ul>\n\
|
||||
<ul class="list-bullet1"><li><span class="">bullet line 2</span></li></ul>\n\
|
||||
<ul class="list-bullet2"><li><span class="">bullet2 line 1</span></li></ul>\n\
|
||||
<ul class="list-bullet2"><li><span class="">bullet2 line 2</span></li></ul>\n\
|
||||
<br>\n'));
|
||||
helper.waitFor(() => expect(getinnertext()).to.be(
|
||||
'<ul class="list-bullet1"><li><span class="">bullet line 1</span></li></ul>\n' +
|
||||
'<ul class="list-bullet1"><li><span class="">bullet line 2</span></li></ul>\n' +
|
||||
'<ul class="list-bullet2"><li><span class="">bullet2 line 1</span></li></ul>\n' +
|
||||
'<ul class="list-bullet2"><li><span class="">bullet2 line 2</span></li></ul>\n' +
|
||||
'<br>\n'));
|
||||
const results = exportfunc(helper.padChrome$.window.location.href);
|
||||
expect(results[0][1]).to.be('<ul class="bullet"><li>bullet line 1</li><li>bullet line 2</li><ul class="bullet"><li>bullet2 line 1</li><li>bullet2 line 2</li></ul></ul><br>');
|
||||
expect(results[1][1]).to.be('\t* bullet line 1\n\t* bullet line 2\n\t\t* bullet2 line 1\n\t\t* bullet2 line 2\n\n');
|
||||
expect(results[0][1]).to.be(
|
||||
'<ul class="bullet"><li>bullet line 1</li><li>bullet line 2</li>' +
|
||||
'<ul class="bullet"><li>bullet2 line 1</li><li>bullet2 line 2</li></ul></ul><br>');
|
||||
expect(results[1][1])
|
||||
.to.be('\t* bullet line 1\n\t* bullet line 2\n' +
|
||||
'\t\t* bullet2 line 1\n\t\t* bullet2 line 2\n\n');
|
||||
done();
|
||||
});
|
||||
xit('import a pad with bullets and newlines from html', function (done) {
|
||||
const importurl = `${helper.padChrome$.window.location.href}/import`;
|
||||
const htmlWithBullets = '<html><body><ul class="list-bullet1"><li>bullet line 1</li></ul><br/><ul class="list-bullet1"><li>bullet line 2</li><ul class="list-bullet2"><li>bullet2 line 1</li></ul></ul><br/><ul class="list-bullet1"><ul class="list-bullet2"><li>bullet2 line 2</li></ul></ul></body></html>';
|
||||
const htmlWithBullets = '<html><body><ul class="list-bullet1"><li>bullet line 1</li>' +
|
||||
'</ul><br/><ul class="list-bullet1"><li>bullet line 2</li><ul class="list-bullet2">' +
|
||||
'<li>bullet2 line 1</li></ul></ul><br/><ul class="list-bullet1">' +
|
||||
'<ul class="list-bullet2"><li>bullet2 line 2</li></ul></ul></body></html>';
|
||||
importrequest(htmlWithBullets, importurl, 'html');
|
||||
helper.waitFor(() => expect(getinnertext()).to.be('\
|
||||
<ul class="list-bullet1"><li><span class="">bullet line 1</span></li></ul>\n\
|
||||
<br>\n\
|
||||
<ul class="list-bullet1"><li><span class="">bullet line 2</span></li></ul>\n\
|
||||
<ul class="list-bullet2"><li><span class="">bullet2 line 1</span></li></ul>\n\
|
||||
<br>\n\
|
||||
<ul class="list-bullet2"><li><span class="">bullet2 line 2</span></li></ul>\n\
|
||||
<br>\n'));
|
||||
helper.waitFor(() => expect(getinnertext()).to.be(
|
||||
'<ul class="list-bullet1"><li><span class="">bullet line 1</span></li></ul>\n' +
|
||||
'<br>\n' +
|
||||
'<ul class="list-bullet1"><li><span class="">bullet line 2</span></li></ul>\n' +
|
||||
'<ul class="list-bullet2"><li><span class="">bullet2 line 1</span></li></ul>\n' +
|
||||
'<br>\n' +
|
||||
'<ul class="list-bullet2"><li><span class="">bullet2 line 2</span></li></ul>\n' +
|
||||
'<br>\n'));
|
||||
const results = exportfunc(helper.padChrome$.window.location.href);
|
||||
expect(results[0][1]).to.be('<ul class="bullet"><li>bullet line 1</li></ul><br><ul class="bullet"><li>bullet line 2</li><ul class="bullet"><li>bullet2 line 1</li></ul></ul><br><ul><ul class="bullet"><li>bullet2 line 2</li></ul></ul><br>');
|
||||
expect(results[1][1]).to.be('\t* bullet line 1\n\n\t* bullet line 2\n\t\t* bullet2 line 1\n\n\t\t* bullet2 line 2\n\n');
|
||||
expect(results[0][1]).to.be(
|
||||
'<ul class="bullet"><li>bullet line 1</li></ul><br><ul class="bullet">' +
|
||||
'<li>bullet line 2</li><ul class="bullet"><li>bullet2 line 1</li></ul>' +
|
||||
'</ul><br><ul><ul class="bullet"><li>bullet2 line 2</li></ul></ul><br>');
|
||||
expect(results[1][1]).to.be(
|
||||
'\t* bullet line 1\n\n\t* bullet line 2\n\t\t* bullet2 line 1\n\n\t\t* bullet2 line 2\n\n');
|
||||
done();
|
||||
});
|
||||
xit('import a pad with bullets and newlines and attributes from html', function (done) {
|
||||
const importurl = `${helper.padChrome$.window.location.href}/import`;
|
||||
const htmlWithBullets = '<html><body><ul class="list-bullet1"><li>bullet line 1</li></ul><br/><ul class="list-bullet1"><li>bullet line 2</li><ul class="list-bullet2"><li>bullet2 line 1</li></ul></ul><br/><ul class="list-bullet1"><ul class="list-bullet2"><ul class="list-bullet3"><ul class="list-bullet4"><li><span class="b s i u"><b><i><s><u>bullet4 line 2 bisu</u></s></i></b></span></li><li><span class="b s "><b><s>bullet4 line 2 bs</s></b></span></li><li><span class="u"><u>bullet4 line 2 u</u></span><span class="u i s"><i><s><u>uis</u></s></i></span></li></ul></ul></ul></ul></body></html>';
|
||||
const htmlWithBullets = '<html><body><ul class="list-bullet1"><li>bullet line 1</li>' +
|
||||
'</ul><br/><ul class="list-bullet1"><li>bullet line 2</li>' +
|
||||
'<ul class="list-bullet2"><li>bullet2 line 1</li></ul></ul>' +
|
||||
'<br/><ul class="list-bullet1"><ul class="list-bullet2"><ul class="list-bullet3">' +
|
||||
'<ul class="list-bullet4"><li><span class="b s i u"><b><i>' +
|
||||
'<s><u>bullet4 line 2 bisu</u></s></i></b></span></li><li>' +
|
||||
'<span class="b s "><b><s>bullet4 line 2 bs</s></b></span></li>' +
|
||||
'<li><span class="u"><u>bullet4 line 2 u</u></span><span class="u i s">' +
|
||||
'<i><s><u>uis</u></s></i></span></li></ul></ul></ul></ul></body></html>';
|
||||
importrequest(htmlWithBullets, importurl, 'html');
|
||||
helper.waitFor(() => expect(getinnertext()).to.be('\
|
||||
<ul class="list-bullet1"><li><span class="">bullet line 1</span></li></ul>\n\<br>\n\
|
||||
<ul class="list-bullet1"><li><span class="">bullet line 2</span></li></ul>\n\
|
||||
<ul class="list-bullet2"><li><span class="">bullet2 line 1</span></li></ul>\n<br>\n\
|
||||
<ul class="list-bullet4"><li><span class="b i s u"><b><i><s><u>bullet4 line 2 bisu</u></s></i></b></span></li></ul>\n\
|
||||
<ul class="list-bullet4"><li><span class="b s"><b><s>bullet4 line 2 bs</s></b></span></li></ul>\n\
|
||||
<ul class="list-bullet4"><li><span class="u"><u>bullet4 line 2 u</u></span><span class="i s u"><i><s><u>uis</u></s></i></span></li></ul>\n\
|
||||
<br>\n'));
|
||||
helper.waitFor(() => expect(getinnertext()).to.be(
|
||||
'<ul class="list-bullet1"><li><span class="">bullet line 1</span></li></ul>\n<br>\n' +
|
||||
'<ul class="list-bullet1"><li><span class="">bullet line 2</span></li></ul>\n' +
|
||||
'<ul class="list-bullet2"><li><span class="">bullet2 line 1</span></li></ul>\n<br>\n' +
|
||||
'<ul class="list-bullet4"><li><span class="b i s u">' +
|
||||
'<b><i><s><u>bullet4 line 2 bisu</u></s></i></b></span></li></ul>\n' +
|
||||
'<ul class="list-bullet4"><li><span class="b s">' +
|
||||
'<b><s>bullet4 line 2 bs</s></b></span></li></ul>\n' +
|
||||
'<ul class="list-bullet4"><li><span class="u"><u>bullet4 line 2 u</u>' +
|
||||
'</span><span class="i s u"><i><s><u>uis</u></s></i></span></li></ul>\n' +
|
||||
'<br>\n'));
|
||||
const results = exportfunc(helper.padChrome$.window.location.href);
|
||||
expect(results[0][1]).to.be('<ul class="bullet"><li>bullet line 1</li></ul><br><ul class="bullet"><li>bullet line 2</li><ul class="bullet"><li>bullet2 line 1</li></ul></ul><br><ul><ul><ul><ul class="bullet"><li><strong><em><s><u>bullet4 line 2 bisu</u></s></em></strong></li><li><strong><s>bullet4 line 2 bs</s></strong></li><li><u>bullet4 line 2 u<em><s>uis</s></em></u></li></ul></ul></ul></ul><br>');
|
||||
expect(results[1][1]).to.be('\t* bullet line 1\n\n\t* bullet line 2\n\t\t* bullet2 line 1\n\n\t\t\t\t* bullet4 line 2 bisu\n\t\t\t\t* bullet4 line 2 bs\n\t\t\t\t* bullet4 line 2 uuis\n\n');
|
||||
expect(results[0][1]).to.be(
|
||||
'<ul class="bullet"><li>bullet line 1</li></ul>' +
|
||||
'<br><ul class="bullet"><li>bullet line 2</li><ul class="bullet"><li>bullet2 line 1</li>' +
|
||||
'</ul></ul><br><ul><ul><ul><ul class="bullet"><li><strong><em><s><u>bullet4 line 2 bisu' +
|
||||
'</u></s></em></strong></li><li><strong><s>bullet4 line 2 bs</s></strong>' +
|
||||
'</li><li><u>bullet4 line 2 u<em><s>uis</s></em></u></li></ul></ul></ul></ul><br>');
|
||||
expect(results[1][1]).to.be(
|
||||
'\t* bullet line 1\n\n\t* bullet line 2\n\t\t* bullet2 line 1\n\n\t\t\t\t* bullet4 line 2' +
|
||||
' bisu\n\t\t\t\t* bullet4 line 2 bs\n\t\t\t\t* bullet4 line 2 uuis\n\n');
|
||||
done();
|
||||
});
|
||||
xit('import a pad with nested bullets from html', function (done) {
|
||||
const importurl = `${helper.padChrome$.window.location.href}/import`;
|
||||
const htmlWithBullets = '<html><body><ul class="list-bullet1"><li>bullet line 1</li></ul><ul class="list-bullet1"><li>bullet line 2</li><ul class="list-bullet2"><li>bullet2 line 1</li></ul></ul><ul class="list-bullet1"><ul class="list-bullet2"><ul class="list-bullet3"><ul class="list-bullet4"><li>bullet4 line 2</li><li>bullet4 line 2</li><li>bullet4 line 2</li></ul><li>bullet3 line 1</li></ul></ul><li>bullet2 line 1</li></ul></body></html>';
|
||||
const htmlWithBullets = '<html><body><ul class="list-bullet1"><li>bullet line 1</li>' +
|
||||
'</ul><ul class="list-bullet1"><li>bullet line 2</li><ul class="list-bullet2">' +
|
||||
'<li>bullet2 line 1</li></ul></ul><ul class="list-bullet1"><ul class="list-bullet2">' +
|
||||
'<ul class="list-bullet3"><ul class="list-bullet4"><li>bullet4 line 2</li>' +
|
||||
'<li>bullet4 line 2</li><li>bullet4 line 2</li></ul><li>bullet3 line 1</li></ul>' +
|
||||
'</ul><li>bullet2 line 1</li></ul></body></html>';
|
||||
importrequest(htmlWithBullets, importurl, 'html');
|
||||
const oldtext = getinnertext();
|
||||
helper.waitFor(() => oldtext != getinnertext()
|
||||
helper.waitFor(() => oldtext !== getinnertext()
|
||||
// return expect(getinnertext()).to.be('\
|
||||
// <ul class="list-bullet1"><li><span class="">bullet line 1</span></li></ul>\n\
|
||||
// <ul class="list-bullet1"><li><span class="">bullet line 2</span></li></ul>\n\
|
||||
|
@ -148,73 +201,127 @@ describe('import functionality', function () {
|
|||
);
|
||||
|
||||
const results = exportfunc(helper.padChrome$.window.location.href);
|
||||
expect(results[0][1]).to.be('<ul class="bullet"><li>bullet line 1</li><li>bullet line 2</li><ul class="bullet"><li>bullet2 line 1</li><ul><ul class="bullet"><li>bullet4 line 2</li><li>bullet4 line 2</li><li>bullet4 line 2</li></ul><li>bullet3 line 1</li></ul></ul><li>bullet2 line 1</li></ul><br>');
|
||||
expect(results[1][1]).to.be('\t* bullet line 1\n\t* bullet line 2\n\t\t* bullet2 line 1\n\t\t\t\t* bullet4 line 2\n\t\t\t\t* bullet4 line 2\n\t\t\t\t* bullet4 line 2\n\t\t\t* bullet3 line 1\n\t* bullet2 line 1\n\n');
|
||||
expect(results[0][1]).to.be(
|
||||
'<ul class="bullet"><li>bullet line 1</li><li>bullet line 2</li>' +
|
||||
'<ul class="bullet"><li>bullet2 line 1</li><ul><ul class="bullet"><li>bullet4 line 2</li>' +
|
||||
'<li>bullet4 line 2</li><li>bullet4 line 2</li></ul><li>bullet3 line 1</li></ul></ul>' +
|
||||
'<li>bullet2 line 1</li></ul><br>');
|
||||
expect(results[1][1]).to.be(
|
||||
'\t* bullet line 1\n\t* bullet line 2\n\t\t* bullet2 line 1\n\t\t\t\t* bullet4 line 2' +
|
||||
'\n\t\t\t\t* bullet4 line 2\n\t\t\t\t* bullet4 line 2\n\t\t\t* bullet3 line 1' +
|
||||
'\n\t* bullet2 line 1\n\n');
|
||||
done();
|
||||
});
|
||||
xit('import a pad with 8 levels of bullets and newlines and attributes from html', function (done) {
|
||||
xit('import with 8 levels of bullets and newlines and attributes from html', function (done) {
|
||||
const importurl = `${helper.padChrome$.window.location.href}/import`;
|
||||
const htmlWithBullets = '<html><body><ul class="list-bullet1"><li>bullet line 1</li></ul><br/><ul class="list-bullet1"><li>bullet line 2</li><ul class="list-bullet2"><li>bullet2 line 1</li></ul></ul><br/><ul class="list-bullet1"><ul class="list-bullet2"><ul class="list-bullet3"><ul class="list-bullet4"><li><span class="b s i u"><b><i><s><u>bullet4 line 2 bisu</u></s></i></b></span></li><li><span class="b s "><b><s>bullet4 line 2 bs</s></b></span></li><li><span class="u"><u>bullet4 line 2 u</u></span><span class="u i s"><i><s><u>uis</u></s></i></span></li><ul class="list-bullet5"><ul class="list-bullet6"><ul class="list-bullet7"><ul class="list-bullet8"><li><span class="">foo</span></li><li><span class="b s"><b><s>foobar bs</b></s></span></li></ul></ul></ul></ul><ul class="list-bullet5"><li>foobar</li></ul></ul></ul></ul></body></html>';
|
||||
const htmlWithBullets =
|
||||
'<html><body><ul class="list-bullet1"><li>bullet line 1</li>' +
|
||||
'</ul><br/><ul class="list-bullet1"><li>bullet line 2</li><ul class="list-bullet2"><li>' +
|
||||
'bullet2 line 1</li></ul></ul><br/><ul class="list-bullet1"><ul class="list-bullet2">' +
|
||||
'<ul class="list-bullet3"><ul class="list-bullet4"><li><span class="b s i u"><b><i>' +
|
||||
'<s><u>bullet4 line 2 bisu</u></s></i></b></span></li><li><span class="b s "><b><s>' +
|
||||
'bullet4 line 2 bs</s></b></span></li><li><span class="u"><u>bullet4 line 2 u' +
|
||||
'</u></span><span class="u i s"><i><s><u>uis</u></s></i></span></li>' +
|
||||
'<ul class="list-bullet5"><ul class="list-bullet6"><ul class="list-bullet7">' +
|
||||
'<ul class="list-bullet8"><li><span class="">foo</span></li><li><span class="b s">' +
|
||||
'<b><s>foobar bs</b></s></span></li></ul></ul></ul></ul><ul class="list-bullet5">' +
|
||||
'<li>foobar</li></ul></ul></ul></ul></body></html>';
|
||||
importrequest(htmlWithBullets, importurl, 'html');
|
||||
helper.waitFor(() => expect(getinnertext()).to.be('\
|
||||
<ul class="list-bullet1"><li><span class="">bullet line 1</span></li></ul>\n\<br>\n\
|
||||
<ul class="list-bullet1"><li><span class="">bullet line 2</span></li></ul>\n\
|
||||
<ul class="list-bullet2"><li><span class="">bullet2 line 1</span></li></ul>\n<br>\n\
|
||||
<ul class="list-bullet4"><li><span class="b i s u"><b><i><s><u>bullet4 line 2 bisu</u></s></i></b></span></li></ul>\n\
|
||||
<ul class="list-bullet4"><li><span class="b s"><b><s>bullet4 line 2 bs</s></b></span></li></ul>\n\
|
||||
<ul class="list-bullet4"><li><span class="u"><u>bullet4 line 2 u</u></span><span class="i s u"><i><s><u>uis</u></s></i></span></li></ul>\n\
|
||||
<ul class="list-bullet8"><li><span class="">foo</span></li></ul>\n\
|
||||
<ul class="list-bullet8"><li><span class="b s"><b><s>foobar bs</s></b></span></li></ul>\n\
|
||||
<ul class="list-bullet5"><li><span class="">foobar</span></li></ul>\n\
|
||||
<br>\n'));
|
||||
helper.waitFor(() => expect(getinnertext()).to.be(
|
||||
'<ul class="list-bullet1"><li><span class="">bullet line 1</span></li></ul>\n<br>\n' +
|
||||
'<ul class="list-bullet1"><li><span class="">bullet line 2</span></li></ul>\n' +
|
||||
'<ul class="list-bullet2"><li><span class="">bullet2 line 1</span></li></ul>\n<br>\n' +
|
||||
'<ul class="list-bullet4"><li><span class="b i s u"><b><i><s><u>bullet4 line 2 bisu</u>' +
|
||||
'</s></i></b></span></li></ul>\n' +
|
||||
'<ul class="list-bullet4"><li><span class="b s"><b><s>bullet4 line 2 bs</s></b>' +
|
||||
'</span></li></ul>\n' +
|
||||
'<ul class="list-bullet4"><li><span class="u"><u>bullet4 line 2 u</u></span>' +
|
||||
'<span class="i s u"><i><s><u>uis</u></s>' +
|
||||
'</i></span></li></ul>\n' +
|
||||
'<ul class="list-bullet8"><li><span class="">foo</span></li></ul>\n' +
|
||||
'<ul class="list-bullet8"><li><span class="b s"><b><s>foobar bs</s></b>' +
|
||||
'</span></li></ul>\n' +
|
||||
'<ul class="list-bullet5"><li><span class="">foobar</span></li></ul>\n' +
|
||||
'<br>\n'));
|
||||
const results = exportfunc(helper.padChrome$.window.location.href);
|
||||
expect(results[0][1]).to.be('<ul class="bullet"><li>bullet line 1</li></ul><br><ul class="bullet"><li>bullet line 2</li><ul class="bullet"><li>bullet2 line 1</li></ul></ul><br><ul><ul><ul><ul class="bullet"><li><strong><em><s><u>bullet4 line 2 bisu</u></s></em></strong></li><li><strong><s>bullet4 line 2 bs</s></strong></li><li><u>bullet4 line 2 u<em><s>uis</s></em></u></li><ul><ul><ul><ul class="bullet"><li>foo</li><li><strong><s>foobar bs</s></strong></li></ul></ul></ul><li>foobar</li></ul></ul></ul></ul></ul><br>');
|
||||
expect(results[1][1]).to.be('\t* bullet line 1\n\n\t* bullet line 2\n\t\t* bullet2 line 1\n\n\t\t\t\t* bullet4 line 2 bisu\n\t\t\t\t* bullet4 line 2 bs\n\t\t\t\t* bullet4 line 2 uuis\n\t\t\t\t\t\t\t\t* foo\n\t\t\t\t\t\t\t\t* foobar bs\n\t\t\t\t\t* foobar\n\n');
|
||||
expect(results[0][1]).to.be(
|
||||
'<ul class="bullet"><li>bullet line 1</li></ul><br><ul class="bullet">' +
|
||||
'<li>bullet line 2</li><ul class="bullet"><li>bullet2 line 1</li></ul></ul>' +
|
||||
'<br><ul><ul><ul><ul class="bullet"><li><strong><em><s><u>' +
|
||||
'bullet4 line 2 bisu</u></s></em></strong></li><li><strong><s>' +
|
||||
'bullet4 line 2 bs</s></strong></li><li><u>bullet4 line 2 u<em>' +
|
||||
'<s>uis</s></em></u></li><ul><ul><ul><ul class="bullet"><li>foo</li>' +
|
||||
'<li><strong><s>foobar bs</s></strong></li></ul></ul></ul><li>foobar</li>' +
|
||||
'</ul></ul></ul></ul></ul><br>');
|
||||
expect(results[1][1]).to.be(
|
||||
'\t* bullet line 1\n\n\t* bullet line 2\n\t\t* ' +
|
||||
'bullet2 line 1\n\n\t\t\t\t* bullet4 line 2 bisu\n\t\t\t\t* bullet4 line 2 ' +
|
||||
'bs\n\t\t\t\t* bullet4 line 2 uuis\n\t\t\t\t\t\t\t\t* foo\n\t\t\t\t\t\t\t\t* ' +
|
||||
'foobar bs\n\t\t\t\t\t* foobar\n\n');
|
||||
done();
|
||||
});
|
||||
|
||||
xit('import a pad with ordered lists from html', function (done) {
|
||||
const importurl = `${helper.padChrome$.window.location.href}/import`;
|
||||
const htmlWithBullets = '<html><body><ol class="list-number1" start="1"><li>number 1 line 1</li></ol><ol class="list-number1" start="2"><li>number 2 line 2</li></ol></body></html>';
|
||||
const htmlWithBullets = '<html><body><ol class="list-number1" start="1">' +
|
||||
'<li>number 1 line 1</li></ol><ol class="list-number1" start="2">' +
|
||||
'<li>number 2 line 2</li></ol></body></html>';
|
||||
importrequest(htmlWithBullets, importurl, 'html');
|
||||
console.error(getinnertext());
|
||||
expect(getinnertext()).to.be('\
|
||||
<ol class="list-number1" start="1"><li><span class="">number 1 line 1</span></li></ol>\n\
|
||||
<ol class="list-number1" start="2"><li><span class="">number 2 line 2</span></li></ol>\n\
|
||||
<br>\n');
|
||||
expect(getinnertext()).to.be(
|
||||
'<ol class="list-number1" start="1"><li><span class="">number 1 line 1</span></li></ol>\n' +
|
||||
'<ol class="list-number1" start="2"><li><span class="">number 2 line 2</span></li></ol>\n' +
|
||||
'<br>\n');
|
||||
const results = exportfunc(helper.padChrome$.window.location.href);
|
||||
expect(results[0][1]).to.be('<ol class="list-number1" start="1"><li>number 1 line 1</li></ol><ol class="list-number1" start="2"><li>number 2 line 2</li></ol>');
|
||||
expect(results[0][1]).to.be(
|
||||
'<ol class="list-number1" start="1"><li>number 1 line 1</li>' +
|
||||
'</ol><ol class="list-number1" start="2"><li>number 2 line 2</li></ol>');
|
||||
expect(results[1][1]).to.be('');
|
||||
done();
|
||||
});
|
||||
xit('import a pad with ordered lists and newlines from html', function (done) {
|
||||
const importurl = `${helper.padChrome$.window.location.href}/import`;
|
||||
const htmlWithBullets = '<html><body><ol class="list-number1" start="1"><li>number 9 line 1</li></ol><br/><ol class="list-number1" start="2"><li>number 10 line 2</li><ol class="list-number2"><li>number 2 times line 1</li></ol></ol><br/><ol class="list-bullet1"><ol class="list-number2"><li>number 2 times line 2</li></ol></ol></body></html>';
|
||||
const htmlWithBullets = '<html><body><ol class="list-number1" start="1">' +
|
||||
'<li>number 9 line 1</li></ol><br/><ol class="list-number1" start="2">' +
|
||||
'<li>number 10 line 2</li><ol class="list-number2">' +
|
||||
'<li>number 2 times line 1</li></ol></ol><br/><ol class="list-bullet1">' +
|
||||
'<ol class="list-number2"><li>number 2 times line 2</li></ol></ol></body></html>';
|
||||
importrequest(htmlWithBullets, importurl, 'html');
|
||||
expect(getinnertext()).to.be('\
|
||||
<ol class="list-number1" start="1"><li><span class="">number 9 line 1</span></li></ol>\n\
|
||||
<br>\n\
|
||||
<ol class="list-number1" start="2"><li><span class="">number 10 line 2</span></li></ol>\n\
|
||||
<ol class="list-number2"><li><span class="">number 2 times line 1</span></li></ol>\n\
|
||||
<br>\n\
|
||||
<ol class="list-number2"><li><span class="">number 2 times line 2</span></li></ol>\n\
|
||||
<br>\n');
|
||||
expect(getinnertext()).to.be(
|
||||
'<ol class="list-number1" start="1"><li><span class="">number 9 line 1</span></li></ol>\n' +
|
||||
'<br>\n' +
|
||||
'<ol class="list-number1" start="2"><li><span class="">number 10 line 2</span></li>' +
|
||||
'</ol>\n' +
|
||||
'<ol class="list-number2"><li><span class="">number 2 times line 1</span></li></ol>\n' +
|
||||
'<br>\n' +
|
||||
'<ol class="list-number2"><li><span class="">number 2 times line 2</span></li></ol>\n' +
|
||||
'<br>\n');
|
||||
const results = exportfunc(helper.padChrome$.window.location.href);
|
||||
console.error(results);
|
||||
done();
|
||||
});
|
||||
xit('import a pad with nested ordered lists and attributes and newlines from html', function (done) {
|
||||
xit('import with nested ordered lists and attributes and newlines from html', function (done) {
|
||||
const importurl = `${helper.padChrome$.window.location.href}/import`;
|
||||
const htmlWithBullets = '<html><body><ol class="list-number1" start="1"><li><span class="b s i u"><b><i><s><u>bold strikethrough italics underline</u></s><i/></b></span> line <span class="b"><b>1bold</b></span></li></ol><br/><span class="i"><i><ol class="list-number1" start="2"><li>number 10 line 2</li><ol class="list-number2"><li>number 2 times line 1</li></ol></ol></i></span><br/><ol class="list-bullet1"><ol class="list-number2"><li>number 2 times line 2</li></ol></ol></body></html>';
|
||||
const htmlWithBullets = '<html><body><ol class="list-number1" start="1"><li>' +
|
||||
'<span class="b s i u"><b><i><s><u>bold strikethrough italics underline</u>' +
|
||||
'</s><i/></b></span> line <span class="b"><b>1bold</b></span></li>' +
|
||||
'</ol><br/><span class="i"><i><ol class="list-number1" start="2">' +
|
||||
'<li>number 10 line 2</li><ol class="list-number2">' +
|
||||
'<li>number 2 times line 1</li></ol></ol></i></span><br/>' +
|
||||
'<ol class="list-bullet1"><ol class="list-number2">' +
|
||||
'<li>number 2 times line 2</li></ol></ol></body></html>';
|
||||
importrequest(htmlWithBullets, importurl, 'html');
|
||||
expect(getinnertext()).to.be('\
|
||||
<ol class="list-number1"><li><span class="b i s u"><b><i><s><u>bold strikethrough italics underline</u></s></i></b></span><span class=""> line </span><span class="b"><b>1bold</b></span></li></ol>\n\
|
||||
<br>\n\
|
||||
<ol class="list-number1"><li><span class="i"><i>number 10 line 2</i></span></li></ol>\n\
|
||||
<ol class="list-number2"><li><span class="i"><i>number 2 times line 1</i></span></li></ol>\n\
|
||||
<br>\n\
|
||||
<ol class="list-number2"><li><span class="">number 2 times line 2</span></li></ol>\n\
|
||||
<br>\n');
|
||||
expect(getinnertext()).to.be(
|
||||
'<ol class="list-number1"><li><span class="b i s u"><b><i><s><u>' +
|
||||
'bold strikethrough italics underline</u></s></i></b></span><span class="">' +
|
||||
' line </span><span class="b"><b>1bold</b></span></li></ol>\n' +
|
||||
'<br>\n' +
|
||||
'<ol class="list-number1"><li><span class="i"><i>number 10 line 2</i></span></li></ol>\n' +
|
||||
'<ol class="list-number2"><li><span class="i">' +
|
||||
'<i>number 2 times line 1</i></span></li></ol>\n' +
|
||||
'<br>\n' +
|
||||
'<ol class="list-number2"><li><span class="">number 2 times line 2</span></li></ol>\n' +
|
||||
'<br>\n');
|
||||
const results = exportfunc(helper.padChrome$.window.location.href);
|
||||
console.error(results);
|
||||
done();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue