Commit 88388867 authored by Roque's avatar Roque

erp5_officejs_ui_test: update only office test to migration

parent b343b610
......@@ -11,12 +11,13 @@
}),
gadget = this;
return storage.put('bad_document', {
'filename': 'test.xlsx',
'reference': 'bad_document_ooffice_upload',
'title': 'Bad Document',
'filename': 'test.xlsx',
'portal_type': 'Spreadsheet',
'mime_type': 'xlsx',
'modification_date': 'Fri, 17 Aug 2018 11:21:22 +0000',
'content_type': "application/x-asc-spreadsheet"
'parent_relative_url': "document_module",
'content_type': "application/x-asc-spreadsheet",
'modification_date': 'Fri, 17 Aug 2018 11:21:22 +0000'
})
.push(function (id) {
return jIO.util.ajax({
......@@ -42,6 +43,10 @@
var div = document.createElement('div');
div.textContent = 'Document Created';
gadget.element.appendChild(div);
}, function (error) {
var div = document.createElement('div');
div.textContent = 'Error creating document: ' + error.message;
gadget.element.appendChild(div);
});
});
}(window, rJS, jIO, document, URL));
......@@ -4,10 +4,11 @@
"use strict";
function check(gadget, storage, format) {
var output_message = "output_message not set - there was an error";
return new RSVP.Queue()
.push(function () {
return RSVP.all([
storage.getAttachment('test', format),
storage.getAttachment('test', 'data'),
jIO.util.ajax({
type: "GET",
url: new URL('./test_ooo_' + gadget.param.type + '.' + format, window.location.href),
......@@ -20,13 +21,16 @@
jIO.util.readBlobAsText(result[0]),
jIO.util.readBlobAsText(result[1].target.response)
]);
}, function (error) {
output_message = 'ERROR converting document: ' + error.message;
})
.push(function (result) {
var div = window.document.createElement('div');
if (result[0].target.response == result[1].target.response) {
div.textContent = 'Converted ' + format + ' OK';
gadget.element.appendChild(div);
if (result && result[0].target.response == result[1].target.response) {
output_message = 'Converted ' + format + ' OK';
}
div.textContent = output_message;
gadget.element.appendChild(div);
});
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment