1
1
import type { Mock } from 'vitest' ;
2
2
import { describe , it , expect , vi , beforeEach } from 'vitest' ;
3
- import type { DepositionMetadata } from './index.js' ;
4
- import { AccessRight , UploadType , ZenodoClient } from './index.js' ;
3
+ import { ZenodoClient } from './index.js' ;
5
4
import axios from 'axios' ;
6
5
7
6
// Mock axios module
@@ -21,36 +20,4 @@ describe('ZenodoClient Tests', () => {
21
20
it ( 'should instantiate ZenodoClient correctly' , ( ) => {
22
21
expect ( zenodoClient ) . toBeInstanceOf ( ZenodoClient ) ;
23
22
} ) ;
24
-
25
- it ( 'should create a deposition' , async ( ) => {
26
- // Mock response data
27
- const mockDepositionResponse = {
28
- data : {
29
- id : 123456 ,
30
- metadata : {
31
- title : 'Test Deposition' ,
32
- } ,
33
- links : {
34
- bucket : 'https://sandbox.zenodo.org/api/files/fake-bucket-id' ,
35
- } ,
36
- } ,
37
- } ;
38
-
39
- ( zenodoClient as any ) . axiosInstance = {
40
- post : vi . fn ( ) . mockResolvedValue ( mockDepositionResponse ) ,
41
- } ;
42
-
43
- const metadata : DepositionMetadata = {
44
- upload_type : UploadType . presentation ,
45
- publication_date : '2023-10-10' ,
46
- title : 'Test Presentation' ,
47
- creators : [ { name : 'Doe, John' } ] ,
48
- description : 'A test deposition.' ,
49
- access_right : AccessRight . open ,
50
- } ;
51
-
52
- const deposition = await zenodoClient . createDeposition ( metadata ) ;
53
-
54
- expect ( deposition ) . toEqual ( mockDepositionResponse . data ) ;
55
- } ) ;
56
23
} ) ;
0 commit comments