File tree 1 file changed +14
-0
lines changed
packages/file-storage/test
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,20 @@ testMap.forEach((testSuite) => {
134
134
await fileStorage . deleteFile ( { filePath } ) ;
135
135
} ) ;
136
136
137
+ it ( 'moveFile moves a file to a new location and remove the previous one' , async ( ) => {
138
+ const oldFileName = 'oldFileName.txt' ;
139
+ const newFileName = 'newFileName.txt' ;
140
+ await fileStorage . uploadFile ( { filePath : oldFileName , content : 'this is a test' } ) ;
141
+ //
142
+ await fileStorage . moveFile ( { filePath : oldFileName , newFilePath : newFileName } ) ;
143
+ //
144
+ const oldFileExists = await fileStorage . fileExists ( { filePath : oldFileName } ) ;
145
+ expect ( oldFileExists ) . toBe ( false ) ;
146
+ const newFileExists = await fileStorage . fileExists ( { filePath : newFileName } ) ;
147
+ expect ( newFileExists ) . toBe ( true ) ;
148
+ await fileStorage . deleteFile ( { filePath : newFileName } ) ;
149
+ } ) ;
150
+
137
151
it ( 'deleteFile deletes a file' , async ( ) => {
138
152
const filePath = randomUUID ( ) ;
139
153
await fileStorage . uploadFile ( { filePath, content : 'this is a test' } ) ;
You can’t perform that action at this time.
0 commit comments