|
@@ -73,7 +73,7 @@ describe('validate upload data', () => {
|
|
|
.set('uppy-auth-token', token)
|
|
|
.set('Content-Type', 'application/json')
|
|
|
.send({
|
|
|
- endpoint: 'http://master.tus.com/files',
|
|
|
+ endpoint: 'http://master.tus.io/files',
|
|
|
protocol: 'tusInvalid'
|
|
|
})
|
|
|
.expect(400)
|
|
@@ -86,7 +86,7 @@ describe('validate upload data', () => {
|
|
|
.set('uppy-auth-token', token)
|
|
|
.set('Content-Type', 'application/json')
|
|
|
.send({
|
|
|
- endpoint: 'http://master.tus.com/files',
|
|
|
+ endpoint: 'http://master.tus.io/files',
|
|
|
protocol: 'tus',
|
|
|
fieldname: 390
|
|
|
})
|
|
@@ -100,7 +100,7 @@ describe('validate upload data', () => {
|
|
|
.set('uppy-auth-token', token)
|
|
|
.set('Content-Type', 'application/json')
|
|
|
.send({
|
|
|
- endpoint: 'http://master.tus.com/files',
|
|
|
+ endpoint: 'http://master.tus.io/files',
|
|
|
protocol: 'tus',
|
|
|
metadata: 'I am a string instead of object'
|
|
|
})
|
|
@@ -114,7 +114,7 @@ describe('validate upload data', () => {
|
|
|
.set('uppy-auth-token', token)
|
|
|
.set('Content-Type', 'application/json')
|
|
|
.send({
|
|
|
- endpoint: 'http://master.tus.com/files',
|
|
|
+ endpoint: 'http://master.tus.io/files',
|
|
|
protocol: 'tus',
|
|
|
headers: 'I am a string instead of object'
|
|
|
})
|
|
@@ -128,7 +128,7 @@ describe('validate upload data', () => {
|
|
|
.set('uppy-auth-token', token)
|
|
|
.set('Content-Type', 'application/json')
|
|
|
.send({
|
|
|
- endpoint: 'http://master.tus.com/files',
|
|
|
+ endpoint: 'http://master.tus.io/files',
|
|
|
protocol: 'tus',
|
|
|
httpMethod: 'DELETE'
|
|
|
})
|
|
@@ -136,14 +136,34 @@ describe('validate upload data', () => {
|
|
|
.then((res) => expect(res.body.error).toBe('unsupported HTTP METHOD specified'))
|
|
|
})
|
|
|
|
|
|
- test('valid upload data is allowed', () => {
|
|
|
+ test('valid upload data is allowed - tus', () => {
|
|
|
return request(authServer)
|
|
|
.post('/drive/get/README.md')
|
|
|
.set('uppy-auth-token', token)
|
|
|
.set('Content-Type', 'application/json')
|
|
|
.send({
|
|
|
- endpoint: 'http://master.tus.com/files',
|
|
|
+ endpoint: 'http://master.tus.io/files',
|
|
|
protocol: 'tus',
|
|
|
+ httpMethod: 'POST',
|
|
|
+ headers: {
|
|
|
+ customheader: 'header value'
|
|
|
+ },
|
|
|
+ metadata: {
|
|
|
+ mymetadata: 'matadata value'
|
|
|
+ },
|
|
|
+ fieldname: 'uploadField'
|
|
|
+ })
|
|
|
+ .expect(200)
|
|
|
+ })
|
|
|
+
|
|
|
+ test('valid upload data is allowed - s3-multipart', () => {
|
|
|
+ return request(authServer)
|
|
|
+ .post('/drive/get/README.md')
|
|
|
+ .set('uppy-auth-token', token)
|
|
|
+ .set('Content-Type', 'application/json')
|
|
|
+ .send({
|
|
|
+ endpoint: 'http://master.tus.io/files',
|
|
|
+ protocol: 's3-multipart',
|
|
|
httpMethod: 'PUT',
|
|
|
headers: {
|
|
|
customheader: 'header value'
|
|
@@ -164,7 +184,7 @@ describe('download provdier file', () => {
|
|
|
.set('uppy-auth-token', token)
|
|
|
.set('Content-Type', 'application/json')
|
|
|
.send({
|
|
|
- endpoint: 'http://master.tus.com/files',
|
|
|
+ endpoint: 'http://master.tus.io/files',
|
|
|
protocol: 'tus'
|
|
|
})
|
|
|
.expect(200)
|