Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
18
Merge Requests
18
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
jio
Commits
c1cbee9d
Commit
c1cbee9d
authored
Mar 08, 2019
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix erp5 test on node
parent
e25629f2
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
267 additions
and
49 deletions
+267
-49
src/node/jio.js
src/node/jio.js
+15
-4
test/jio.storage/erp5storage.tests.js
test/jio.storage/erp5storage.tests.js
+252
-45
No files found.
src/node/jio.js
View file @
c1cbee9d
...
...
@@ -44,17 +44,28 @@
originalAjax
=
jIO
.
util
.
ajax
;
jIO
.
util
.
ajax
=
function
ajax
(
param
)
{
if
(
param
.
data
instanceof
Blob
)
{
// Copy the param dict document (no need for deep copy) to
// allow tests to check them
param
=
Object
.
assign
({},
param
);
// Blob is not supported by xhr2, so convert to ArrayBuffer instead
return
jIO
.
util
.
readBlobAsArrayBuffer
(
param
.
data
).
then
(
function
(
data
)
{
param
.
data
=
data
.
target
.
result
;
return
originalAjax
(
param
);
});
return
jIO
.
util
.
readBlobAsArrayBuffer
(
param
.
data
)
.
then
(
function
(
data
)
{
param
.
data
=
data
.
target
.
result
;
return
originalAjax
(
param
);
});
}
if
(
param
.
data
instanceof
FormData
)
{
// Copy the param dict document (no need for deep copy) to
// allow tests to check them
param
=
Object
.
assign
({},
param
);
// Implement minimal FormData for erp5storage
if
(
!
param
.
hasOwnProperty
(
'
headers
'
))
{
param
.
headers
=
{};
}
else
{
// Copy the param dict document (no need for deep copy) to
// allow tests to check them
param
.
headers
=
Object
.
assign
({},
param
.
headers
);
}
param
.
headers
[
"
Content-Type
"
]
=
"
multipart
\
/form-data; boundary=
"
+
param
.
data
.
boundary
;
...
...
test/jio.storage/erp5storage.tests.js
View file @
c1cbee9d
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment