Skip to content

Commit 996e0cd

Browse files
authored
[Chore] Update multi-bucket test & type (#13704)
* remove console.log * update storage copy type
1 parent 3623cf6 commit 996e0cd

File tree

4 files changed

+6
-17
lines changed

4 files changed

+6
-17
lines changed

packages/storage/__tests__/providers/s3/apis/copy.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,6 @@ describe('copy API', () => {
384384
},
385385
});
386386
} catch (error: any) {
387-
console.log(error);
388387
expect(error).toBeInstanceOf(StorageError);
389388
expect(error.name).toBe(
390389
StorageValidationErrorCode.InvalidCopyOperationStorageBucket,
@@ -403,7 +402,6 @@ describe('copy API', () => {
403402
},
404403
});
405404
} catch (error: any) {
406-
console.log(error);
407405
expect(error).toBeInstanceOf(StorageError);
408406
expect(error.name).toBe(
409407
StorageValidationErrorCode.InvalidCopyOperationStorageBucket,

packages/storage/__tests__/providers/s3/apis/uploadData/multipartHandlers.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,6 @@ describe('getMultipartUploadHandlers with key', () => {
377377
ContentType: defaultContentType,
378378
}),
379379
);
380-
expect(mockCreateMultipartUpload).toHaveBeenCalledTimes(1);
381-
expect(mockUploadPart).toHaveBeenCalledTimes(2);
382-
expect(mockCompleteMultipartUpload).toHaveBeenCalledTimes(1);
383380
});
384381

385382
it('should override bucket in putObject call when bucket as string', async () => {
@@ -406,9 +403,6 @@ describe('getMultipartUploadHandlers with key', () => {
406403
ContentType: defaultContentType,
407404
}),
408405
);
409-
expect(mockCreateMultipartUpload).toHaveBeenCalledTimes(1);
410-
expect(mockUploadPart).toHaveBeenCalledTimes(2);
411-
expect(mockCompleteMultipartUpload).toHaveBeenCalledTimes(1);
412406
});
413407
});
414408
});

packages/storage/src/providers/s3/types/inputs.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ import {
2020
import {
2121
CopyDestinationOptionsWithKey,
2222
CopySourceOptionsWithKey,
23-
CopyWithPathDestinationOptions,
24-
CopyWithPathSourceOptions,
2523
DownloadDataOptionsWithKey,
2624
DownloadDataOptionsWithPath,
2725
GetPropertiesOptionsWithKey,
@@ -49,10 +47,7 @@ export type CopyInput = StorageCopyInputWithKey<
4947
/**
5048
* Input type with path for S3 copy API.
5149
*/
52-
export type CopyWithPathInput = StorageCopyInputWithPath<
53-
CopyWithPathSourceOptions,
54-
CopyWithPathDestinationOptions
55-
>;
50+
export type CopyWithPathInput = StorageCopyInputWithPath;
5651

5752
/**
5853
* @deprecated Use {@link GetPropertiesWithPathInput} instead.

packages/storage/src/types/inputs.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
import { StrictUnion } from '@aws-amplify/core/internals/utils';
55

6+
import { StorageBucket } from '../providers/s3/types/options';
7+
68
import {
79
StorageListAllOptions,
810
StorageListPaginateOptions,
@@ -90,9 +92,9 @@ export interface StorageCopyInputWithKey<
9092
destination: DestinationOptions;
9193
}
9294

93-
export interface StorageCopyInputWithPath<SourceOptions, DestinationOptions> {
94-
source: StorageOperationInputWithPath & SourceOptions;
95-
destination: StorageOperationInputWithPath & DestinationOptions;
95+
export interface StorageCopyInputWithPath {
96+
source: StorageOperationInputWithPath & { bucket?: StorageBucket };
97+
destination: StorageOperationInputWithPath & { bucket?: StorageBucket };
9698
}
9799

98100
/**

0 commit comments

Comments
 (0)