1
1
import path from 'path' ;
2
2
import { createTestDatabaseConnection } from '../setup' ;
3
3
import { get , post } from '../request' ;
4
- // import { rmdir } from '../../src/utils/fs';
5
- // import { getConfiguration } from '../../src/get-configuration';
6
4
import { createTokenFor } from '../../src/utils/auth' ;
7
5
8
6
describe ( '/library' , ( ) => {
@@ -19,22 +17,22 @@ describe('/library', () => {
19
17
await connection . close ( ) ;
20
18
} ) ;
21
19
22
- describe ( '/upload' , ( ) => {
20
+ describe ( '/upload/zip ' , ( ) => {
23
21
describe ( 'POST' , ( ) => {
24
22
it ( 'should process ZIP archives containing HTML files' , ( ) => {
25
- return post ( '/library/upload' )
23
+ return post ( '/library/upload/zip ' )
26
24
. set ( 'Authorization' , 'Bearer ' + authToken )
27
25
. attach ( 'file' , path . resolve ( __dirname , '../dummy-project.zip' ) )
28
26
. expect ( 200 ) ;
29
27
} ) ;
30
28
it ( 'should handle dupes' , ( ) => {
31
- return post ( '/library/upload' )
29
+ return post ( '/library/upload/zip ' )
32
30
. set ( 'Authorization' , 'Bearer ' + authToken )
33
31
. attach ( 'file' , path . resolve ( __dirname , '../dummy-project.zip' ) )
34
32
. expect ( 200 ) ;
35
33
} ) ;
36
34
it ( 'should return HTTP 400 if no file was attached' , ( ) => {
37
- return post ( '/library/upload' )
35
+ return post ( '/library/upload/zip ' )
38
36
. set ( 'Authorization' , 'Bearer ' + authToken )
39
37
. expect ( 400 ) ;
40
38
} ) ;
0 commit comments