mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
tests: Fix abiword/soffice check
This commit is contained in:
parent
89de03795a
commit
668373b80f
1 changed files with 32 additions and 8 deletions
|
@ -109,7 +109,10 @@ describe('Imports and Exports', function(){
|
||||||
// TODO: fix support for .doc files..
|
// TODO: fix support for .doc files..
|
||||||
it('Tries to import .doc that uses soffice or abiword', function(done) {
|
it('Tries to import .doc that uses soffice or abiword', function(done) {
|
||||||
if(!settings.allowAnyoneToImport) return done();
|
if(!settings.allowAnyoneToImport) return done();
|
||||||
if((settings.abiword && settings.abiword.indexOf("/" === -1)) && (settings.office && settings.soffice.indexOf("/" === -1))) return done();
|
if ((!settings.abiword || settings.abiword.indexOf('/') === -1) &&
|
||||||
|
(!settings.soffice || settings.soffice.indexOf('/') === -1)) {
|
||||||
|
return done();
|
||||||
|
}
|
||||||
|
|
||||||
var req = request.post(host + '/p/'+testPadId+'/import', function (err, res, body) {
|
var req = request.post(host + '/p/'+testPadId+'/import', function (err, res, body) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
@ -132,7 +135,10 @@ describe('Imports and Exports', function(){
|
||||||
|
|
||||||
it('exports DOC', function(done) {
|
it('exports DOC', function(done) {
|
||||||
if(!settings.allowAnyoneToImport) return done();
|
if(!settings.allowAnyoneToImport) return done();
|
||||||
if((settings.abiword && settings.abiword.indexOf("/" === -1)) && (settings.office && settings.soffice.indexOf("/" === -1))) return done();
|
if ((!settings.abiword || settings.abiword.indexOf('/') === -1) &&
|
||||||
|
(!settings.soffice || settings.soffice.indexOf('/') === -1)) {
|
||||||
|
return done();
|
||||||
|
}
|
||||||
try{
|
try{
|
||||||
request(host + '/p/'+testPadId+'/export/doc', function (err, res, body) {
|
request(host + '/p/'+testPadId+'/export/doc', function (err, res, body) {
|
||||||
// TODO: At some point checking that the contents is correct would be suitable
|
// TODO: At some point checking that the contents is correct would be suitable
|
||||||
|
@ -149,7 +155,10 @@ describe('Imports and Exports', function(){
|
||||||
|
|
||||||
it('Tries to import .docx that uses soffice or abiword', function(done) {
|
it('Tries to import .docx that uses soffice or abiword', function(done) {
|
||||||
if(!settings.allowAnyoneToImport) return done();
|
if(!settings.allowAnyoneToImport) return done();
|
||||||
if((settings.abiword && settings.abiword.indexOf("/" === -1)) && (settings.office && settings.soffice.indexOf("/" === -1))) return done();
|
if ((!settings.abiword || settings.abiword.indexOf('/') === -1) &&
|
||||||
|
(!settings.soffice || settings.soffice.indexOf('/') === -1)) {
|
||||||
|
return done();
|
||||||
|
}
|
||||||
|
|
||||||
var req = request.post(host + '/p/'+testPadId+'/import', function (err, res, body) {
|
var req = request.post(host + '/p/'+testPadId+'/import', function (err, res, body) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
@ -172,7 +181,10 @@ describe('Imports and Exports', function(){
|
||||||
|
|
||||||
it('exports DOC from imported DOCX', function(done) {
|
it('exports DOC from imported DOCX', function(done) {
|
||||||
if(!settings.allowAnyoneToImport) return done();
|
if(!settings.allowAnyoneToImport) return done();
|
||||||
if((settings.abiword && settings.abiword.indexOf("/" === -1)) && (settings.office && settings.soffice.indexOf("/" === -1))) return done();
|
if ((!settings.abiword || settings.abiword.indexOf('/') === -1) &&
|
||||||
|
(!settings.soffice || settings.soffice.indexOf('/') === -1)) {
|
||||||
|
return done();
|
||||||
|
}
|
||||||
request(host + '/p/'+testPadId+'/export/doc', function (err, res, body) {
|
request(host + '/p/'+testPadId+'/export/doc', function (err, res, body) {
|
||||||
// TODO: At some point checking that the contents is correct would be suitable
|
// TODO: At some point checking that the contents is correct would be suitable
|
||||||
if(body.length >= 9100){
|
if(body.length >= 9100){
|
||||||
|
@ -185,7 +197,10 @@ describe('Imports and Exports', function(){
|
||||||
|
|
||||||
it('Tries to import .pdf that uses soffice or abiword', function(done) {
|
it('Tries to import .pdf that uses soffice or abiword', function(done) {
|
||||||
if(!settings.allowAnyoneToImport) return done();
|
if(!settings.allowAnyoneToImport) return done();
|
||||||
if((settings.abiword && settings.abiword.indexOf("/" === -1)) && (settings.office && settings.soffice.indexOf("/" === -1))) return done();
|
if ((!settings.abiword || settings.abiword.indexOf('/') === -1) &&
|
||||||
|
(!settings.soffice || settings.soffice.indexOf('/') === -1)) {
|
||||||
|
return done();
|
||||||
|
}
|
||||||
|
|
||||||
var req = request.post(host + '/p/'+testPadId+'/import', function (err, res, body) {
|
var req = request.post(host + '/p/'+testPadId+'/import', function (err, res, body) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
@ -208,7 +223,10 @@ describe('Imports and Exports', function(){
|
||||||
|
|
||||||
it('exports PDF', function(done) {
|
it('exports PDF', function(done) {
|
||||||
if(!settings.allowAnyoneToImport) return done();
|
if(!settings.allowAnyoneToImport) return done();
|
||||||
if((settings.abiword && settings.abiword.indexOf("/" === -1)) && (settings.office && settings.soffice.indexOf("/" === -1))) return done();
|
if ((!settings.abiword || settings.abiword.indexOf('/') === -1) &&
|
||||||
|
(!settings.soffice || settings.soffice.indexOf('/') === -1)) {
|
||||||
|
return done();
|
||||||
|
}
|
||||||
request(host + '/p/'+testPadId+'/export/pdf', function (err, res, body) {
|
request(host + '/p/'+testPadId+'/export/pdf', function (err, res, body) {
|
||||||
// TODO: At some point checking that the contents is correct would be suitable
|
// TODO: At some point checking that the contents is correct would be suitable
|
||||||
if(body.length >= 1000){
|
if(body.length >= 1000){
|
||||||
|
@ -221,7 +239,10 @@ describe('Imports and Exports', function(){
|
||||||
|
|
||||||
it('Tries to import .odt that uses soffice or abiword', function(done) {
|
it('Tries to import .odt that uses soffice or abiword', function(done) {
|
||||||
if(!settings.allowAnyoneToImport) return done();
|
if(!settings.allowAnyoneToImport) return done();
|
||||||
if((settings.abiword && settings.abiword.indexOf("/" === -1)) && (settings.office && settings.soffice.indexOf("/" === -1))) return done();
|
if ((!settings.abiword || settings.abiword.indexOf('/') === -1) &&
|
||||||
|
(!settings.soffice || settings.soffice.indexOf('/') === -1)) {
|
||||||
|
return done();
|
||||||
|
}
|
||||||
|
|
||||||
var req = request.post(host + '/p/'+testPadId+'/import', function (err, res, body) {
|
var req = request.post(host + '/p/'+testPadId+'/import', function (err, res, body) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
@ -244,7 +265,10 @@ describe('Imports and Exports', function(){
|
||||||
|
|
||||||
it('exports ODT', function(done) {
|
it('exports ODT', function(done) {
|
||||||
if(!settings.allowAnyoneToImport) return done();
|
if(!settings.allowAnyoneToImport) return done();
|
||||||
if((settings.abiword && settings.abiword.indexOf("/" === -1)) && (settings.office && settings.soffice.indexOf("/" === -1))) return done();
|
if ((!settings.abiword || settings.abiword.indexOf('/') === -1) &&
|
||||||
|
(!settings.soffice || settings.soffice.indexOf('/') === -1)) {
|
||||||
|
return done();
|
||||||
|
}
|
||||||
request(host + '/p/'+testPadId+'/export/odt', function (err, res, body) {
|
request(host + '/p/'+testPadId+'/export/odt', function (err, res, body) {
|
||||||
// TODO: At some point checking that the contents is correct would be suitable
|
// TODO: At some point checking that the contents is correct would be suitable
|
||||||
if(body.length >= 7000){
|
if(body.length >= 7000){
|
||||||
|
|
Loading…
Reference in a new issue