tests: backed out changeset 155a895604

This was a preparatory commit for 3292429ab3 (which introduced a bug, see
issue #3728) and modified the tests for issue #3620.

Commit 155a895604 per se did not introduce any bugs, but was difficult to
inspect because of its size. For this, the corresponding PR (#3622) should not
have been accepted.

--HG--
branch : revert-3622
This commit is contained in:
muxator 2020-03-18 19:11:48 +01:00 committed by muxator
parent 8261229323
commit c382ba35c9

View file

@ -52,127 +52,125 @@ describe("import functionality", function(){
return exportresults return exportresults
} }
it("import a pad with newlines from txt", function(done){ xit("import a pad with newlines from txt", function(done){
var importurl = helper.padChrome$.window.location.href+'/import';
var textWithNewLines = 'imported text\nnewline';
importrequest(textWithNewLines, importurl, "txt");
helper.waitFor(function(){
return getinnertext().includes('imported text');
}).done(function() {
expect(getinnertext()).to.be('<span class="">imported text</span>\n<span class="">newline</span>\n');
var results = exportfunc(helper.padChrome$.window.location.href);
expect(results[0][1]).to.be("\r\nimported text<br>newline<br>\r\n");
expect(results[1][1]).to.be("imported text\nnewline\n");
done();
});
});
it("import a pad with newlines from html", function(done){
var importurl = helper.padChrome$.window.location.href+'/import';
var htmlWithNewLines = '<html><body>htmltext<br/>newline</body></html>';
importrequest(htmlWithNewLines, importurl, "html");
helper.waitFor(function(){
return getinnertext().includes('htmltext');
}).done(function() {
expect(getinnertext()).to.be('<span class="">htmltext</span>\n<span class="">newline</span>\n<br>\n')
var results = exportfunc(helper.padChrome$.window.location.href);
expect(results[0][1]).to.be("\r\nhtmltext<br>newline<br><br>\r\n");
expect(results[1][1]).to.be("htmltext\nnewline\n\n");
done();
});
})
it("import a pad with attributes from html", function(done){
var importurl = helper.padChrome$.window.location.href+'/import';
var 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(function(){
return getinnertext().includes('<span class="b i s u">');
}).done(function() {
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');
var results = exportfunc(helper.padChrome$.window.location.href);
expect(results[0][1]).to.be('\r\nhtmltext<br><strong><em><s><u>newline</u></s></em></strong><br><br>\r\n');
expect(results[1][1]).to.be('htmltext\nnewline\n\n');
done();
})
})
it("import a pad with bullets from html", function(done){
var importurl = helper.padChrome$.window.location.href+'/import' var importurl = helper.padChrome$.window.location.href+'/import'
var 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>' var textWithNewLines = 'imported text\nnewline'
importrequest(textWithNewLines,importurl,"txt")
helper.waitFor(function(){
return expect(getinnertext()).to.be('<span class="">imported text</span>\n<span class="">newline</span>\n<br>\n')
})
var 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")
done()
})
xit("import a pad with newlines from html", function(done){
var importurl = helper.padChrome$.window.location.href+'/import'
var htmlWithNewLines = '<html><body>htmltext<br/>newline</body></html>'
importrequest(htmlWithNewLines,importurl,"html")
helper.waitFor(function(){
return expect(getinnertext()).to.be('<span class="">htmltext</span>\n<span class="">newline</span>\n<br>\n')
})
var 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")
done()
})
xit("import a pad with attributes from html", function(done){
var importurl = helper.padChrome$.window.location.href+'/import'
var 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(function(){
return 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')
})
var 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[1][1]).to.be('htmltext\nnewline\n\n')
done()
})
xit("import a pad with bullets from html", function(done){
var importurl = helper.padChrome$.window.location.href+'/import'
var 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") importrequest(htmlWithBullets,importurl,"html")
helper.waitFor(function(){ helper.waitFor(function(){
return getinnertext().includes('bullet line 1'); return expect(getinnertext()).to.be('\
}).done(function() { <ul class="list-bullet1"><li><span class="">bullet line 1</span></li></ul>\n\
expect(getinnertext()).to.be( <ul class="list-bullet1"><li><span class="">bullet line 2</span></li></ul>\n\
'<ul class="list-bullet1"><li><span class="">bullet line 1</span></li></ul>\n' + <ul class="list-bullet2"><li><span class="">bullet2 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 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') var results = exportfunc(helper.padChrome$.window.location.href)
var 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[0][1]).to.be('\r\n<ul class="bullet"><li>bullet line 1</li>' + 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')
'<li>bullet line 2<ul class="bullet"><li>bullet2 line 1</li>' + done()
'<li>bullet2 line 2</ul></li></ul><br>\r\n') })
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') xit("import a pad with bullets and newlines from html", function(done){
done(); var importurl = helper.padChrome$.window.location.href+'/import'
}); var 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")
it("import a pad with bullets and newlines from html", function(done){
var importurl = helper.padChrome$.window.location.href+'/import';
var 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(function(){ helper.waitFor(function(){
return getinnertext().includes('list-bullet1'); return expect(getinnertext()).to.be('\
}).done(function() { <ul class="list-bullet1"><li><span class="">bullet line 1</span></li></ul>\n\
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'); <br>\n\
var results = exportfunc(helper.padChrome$.window.location.href); <ul class="list-bullet1"><li><span class="">bullet line 2</span></li></ul>\n\
expect(results[0][1]).to.be('\r\n<ul class="bullet"><li>bullet line 1</ul><br><ul class="bullet"><li>bullet line 2<ul class="bullet"><li>bullet2 line 1</ul></li></ul><br><ul class="bullet"><li><ul class="bullet"><li>bullet2 line 2</ul></li></ul><br>\r\n'); <ul class="list-bullet2"><li><span class="">bullet2 line 1</span></li></ul>\n\
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'); <br>\n\
done(); <ul class="list-bullet2"><li><span class="">bullet2 line 2</span></li></ul>\n\
}); <br>\n')
}); })
it("import a pad with bullets and newlines and attributes from html", function(done){ var results = exportfunc(helper.padChrome$.window.location.href)
var importurl = helper.padChrome$.window.location.href+'/import'; 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>')
var 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>'; 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')
importrequest(htmlWithBullets,importurl,"html"); done()
})
xit("import a pad with bullets and newlines and attributes from html", function(done){
var importurl = helper.padChrome$.window.location.href+'/import'
var 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(function(){ helper.waitFor(function(){
return getinnertext().includes('list-bullet1'); return expect(getinnertext()).to.be('\
}).done(function() {
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 1</span></li></ul>\n\<br>\n\
<ul class="list-bullet1"><li><span class="">bullet line 2</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<br>\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 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="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-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'); <br>\n')
var results = exportfunc(helper.padChrome$.window.location.href); })
expect(results[0][1]).to.be('\r\n<ul class="bullet"><li>bullet line 1</ul><br><ul class="bullet"><li>bullet line 2<ul class="bullet"><li>bullet2 line 1</ul></li></ul><br><ul class="bullet"><li><ul class="bullet"><li><ul class="bullet"><li><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></ul></li></ul></li></ul></li></ul><br>\r\n'); var results = exportfunc(helper.padChrome$.window.location.href)
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>')
done(); 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()
}); })
it("import a pad with nested bullets from html", function(done){ xit("import a pad with nested bullets from html", function(done){
var importurl = helper.padChrome$.window.location.href+'/import'; var importurl = helper.padChrome$.window.location.href+'/import'
var 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>'; var 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"); importrequest(htmlWithBullets,importurl,"html")
var oldtext = getinnertext(); var oldtext=getinnertext()
helper.waitFor(function(){ helper.waitFor(function(){
return getinnertext().includes('list-bullet1'); return oldtext != getinnertext()
}).done(function() { // return expect(getinnertext()).to.be('\
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-bullet4"><li><span class="">bullet4 line 2</span></li></ul>\n<ul class="list-bullet4"><li><span class="">bullet4 line 2</span></li></ul>\n<ul class="list-bullet4"><li><span class="">bullet4 line 2</span></li></ul>\n<ul class="list-bullet3"><li><span class="">bullet3 line 1</span></li></ul>\n<ul class="list-bullet1"><li><span class="">bullet2 line 1</span></li></ul>\n<br>\n'); //<ul class="list-bullet1"><li><span class="">bullet line 1</span></li></ul>\n\
var results = exportfunc(helper.padChrome$.window.location.href); //<ul class="list-bullet1"><li><span class="">bullet line 2</span></li></ul>\n\
expect(results[0][1]).to.be('\r\n<ul class="bullet"><li>bullet line 1</li><li>bullet line 2<ul class="bullet"><li>bullet2 line 1<ul class="bullet"><li><ul class="bullet"><li>bullet4 line 2</li><li>bullet4 line 2</li><li>bullet4 line 2</ul><li>bullet3 line 1</ul></li></ul><li>bullet2 line 1</ul><br>\r\n'); //<ul class="list-bullet2"><li><span class="">bullet2 line 1</span></li></ul>\n\
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'); //<ul class="list-bullet4"><li><span class="">bullet4 line 2</span></li></ul>\n\
done(); //<ul class="list-bullet4"><li><span class="">bullet4 line 2</span></li></ul>\n\
}); //<ul class="list-bullet4"><li><span class="">bullet4 line 2</span></li></ul>\n\
}); //<br>\n')
it("import a pad with 8 levels of bullets and newlines and attributes from html", function(done){ })
var 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')
done()
})
xit("import a pad with 8 levels of bullets and newlines and attributes from html", function(done){
var importurl = helper.padChrome$.window.location.href+'/import' var importurl = helper.padChrome$.window.location.href+'/import'
var 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>' var 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") importrequest(htmlWithBullets,importurl,"html")
helper.waitFor(function(){ helper.waitFor(function(){
return getinnertext().includes('list-bullet1'); return expect(getinnertext()).to.be('\
}).done(function() {
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 1</span></li></ul>\n\<br>\n\
<ul class="list-bullet1"><li><span class="">bullet line 2</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<br>\n\ <ul class="list-bullet2"><li><span class="">bullet2 line 1</span></li></ul>\n<br>\n\
@ -182,54 +180,58 @@ describe("import functionality", function(){
<ul class="list-bullet8"><li><span class="">foo</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-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\ <ul class="list-bullet5"><li><span class="">foobar</span></li></ul>\n\
<br>\n'); <br>\n')
var results = exportfunc(helper.padChrome$.window.location.href); })
expect(results[0][1]).to.be('\r\n<ul class="bullet"><li>bullet line 1</ul><br><ul class="bullet"><li>bullet line 2<ul class="bullet"><li>bullet2 line 1</ul></li></ul><br><ul class="bullet"><li><ul class="bullet"><li><ul class="bullet"><li><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><ul class="bullet"><li><ul class="bullet"><li><ul class="bullet"><li><ul class="bullet"><li>foo</li><li><strong><s>foobar bs</s></strong></ul></li></ul></li></ul><li>foobar</ul></li></ul></li></ul></li></ul></li></ul><br>\r\n') ; var results = exportfunc(helper.padChrome$.window.location.href)
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>')
done(); 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()
}); })
it("import a pad with ordered lists from html", function(done){ xit("import a pad with ordered lists from html", function(done){
var importurl = helper.padChrome$.window.location.href+'/import'; var importurl = helper.padChrome$.window.location.href+'/import'
var 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>'; var 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"); importrequest(htmlWithBullets,importurl,"html")
helper.waitFor(function(){ -console.error(getinnertext())
return getinnertext().includes('list-number1'); expect(getinnertext()).to.be('\
}).done(function() { <ol class="list-number1" start="1"><li><span class="">number 1 line 1</span></li></ol>\n\
expect(getinnertext()).to.be('<ol class="list-number1"><li><span class="">number 1 line 1</span></li></ol>\n<ol class="list-number1"><li><span class="">number 2 line 2</span></li></ol>\n<br>\n'); <ol class="list-number1" start="2"><li><span class="">number 2 line 2</span></li></ol>\n\
var results = exportfunc(helper.padChrome$.window.location.href); <br>\n')
expect(results[0][1]).to.be('\r\n<ol class="number"><li>number 1 line 1</li><li>number 2 line 2</ol><br>\r\n'); var results = exportfunc(helper.padChrome$.window.location.href)
expect(results[1][1]).to.be('\t1. number 1 line 1\n\t1. number 2 line 2\n\n'); 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>')
done(); expect(results[1][1]).to.be('')
}); done()
}); })
it("import a pad with ordered lists and newlines from html", function(done){ xit("import a pad with ordered lists and newlines from html", function(done){
var importurl = helper.padChrome$.window.location.href+'/import'; var importurl = helper.padChrome$.window.location.href+'/import'
var 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>'; var 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"); importrequest(htmlWithBullets,importurl,"html")
helper.waitFor(function(){ expect(getinnertext()).to.be('\
return getinnertext().includes('list-number1'); <ol class="list-number1" start="1"><li><span class="">number 9 line 1</span></li></ol>\n\
}).done(function() { <br>\n\
expect(getinnertext()).to.be('<ol class="list-number1"><li><span class="">number 9 line 1</span></li></ol>\n<br>\n<ol class="list-number1"><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'); <ol class="list-number1" start="2"><li><span class="">number 10 line 2</span></li></ol>\n\
var results = exportfunc(helper.padChrome$.window.location.href); <ol class="list-number2"><li><span class="">number 2 times line 1</span></li></ol>\n\
expect(results[0][1]).to.be('\r\n<ol class="number"><li>number 9 line 1</ol><br><ol class="number"><li>number 10 line 2<ol class="number"><li>number 2 times line 1</ol></li></ol><br><ol class="number"><li><ol class="number"><li>number 2 times line 2</ol></li></ol><br>\r\n'); <br>\n\
expect(results[1][1]).to.be('\t1. number 9 line 1\n\n\t1. number 10 line 2\n\t\t2. number 2 times line 1\n\n\t\t2. number 2 times line 2\n\n'); <ol class="list-number2"><li><span class="">number 2 times line 2</span></li></ol>\n\
done(); <br>\n')
}); var results = exportfunc(helper.padChrome$.window.location.href)
}); console.error(results)
it("import a pad with nested ordered lists and attributes and newlines from html", function(done){ done()
var importurl = helper.padChrome$.window.location.href+'/import'; })
var 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>'; xit("import a pad with nested ordered lists and attributes and newlines from html", function(done){
importrequest(htmlWithBullets,importurl,"html"); var importurl = helper.padChrome$.window.location.href+'/import'
helper.waitFor(function(){ var 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>'
return getinnertext().includes('list-number1'); importrequest(htmlWithBullets,importurl,"html")
}).done(function() { expect(getinnertext()).to.be('\
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'); <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\
var results = exportfunc(helper.padChrome$.window.location.href); <br>\n\
expect(results[0][1]).to.be('\r\n<ol class="number"><li><strong><em><s><u>bold strikethrough italics underline</u></s></em></strong>line<strong>1bold</strong></ol><br><ol class="number"><li><em>number 10 line 2</em><ol class="number"><li><em>number 2 times line 1</em></ol></li></ol><br><ol class="number"><li><ol class="number"><li>number 2 times line 2</ol></li></ol><br>\r\n'); <ol class="list-number1"><li><span class="i"><i>number 10 line 2</i></span></li></ol>\n\
expect(results[1][1]).to.be('\t1. bold strikethrough italics underlineline1bold\n\n\t1. number 10 line 2\n\t\t2. number 2 times line 1\n\n\t\t2. number 2 times line 2\n\n'); <ol class="list-number2"><li><span class="i"><i>number 2 times line 1</i></span></li></ol>\n\
done(); <br>\n\
}); <ol class="list-number2"><li><span class="">number 2 times line 2</span></li></ol>\n\
}); <br>\n')
}); var results = exportfunc(helper.padChrome$.window.location.href)
console.error(results)
done()
})
})