Skip to content
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
devops-at-alinea
html5-formdata
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
html5-formdata
/
tests.js
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
33 lines (28 loc) · 1.04 KB
master
Breadcrumbs
html5-formdata
/
tests.js
Copy path
Top
File metadata and controls
Code
Blame
33 lines (28 loc) · 1.04 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
$(document).ready(function(){
module("FormData");
test("FormData exist", function() {
ok(window.FormData);
});
test("add bad fake property", function() {
var data = new FormData();
ok(data.fake);
});
test("append simple value", function() {
var data = new FormData();
data.append('chuck', 'norris');
data.boundary = '-a';
equal(data, "---a\r\nContent-Disposition: form-data; name=\"chuck\";\r\n\r\nnorris\r\n---a--", "body should correctly formatted");
});
test("append file", function() {
var data = new FormData();
data.append('chuck', {
name: "norris.pdf",
type: "application/pdf",
getAsBinary: function() {
return 'norris';
}
});
data.boundary = '-a';
equal(data, "---a\r\nContent-Disposition: form-data; name=\"chuck\"; filename=\"norris.pdf\"\r\nContent-Type: application/pdf\r\n\r\nnorris\r\n---a--", "body should correctly formatted");
});
});
You can’t perform that action at this time.