From 434a57a74d73d28a3a443516cc75a64d1616ae7b Mon Sep 17 00:00:00 2001 From: Jordan Nelson Date: Mon, 25 Mar 2024 17:31:58 -0400 Subject: [PATCH] chore: update tests --- .../content_type_infer/content_type_infer_html.dart | 10 ++++++++-- .../content_type_infer/content_type_infer_io.dart | 11 ++++++++--- .../example/integration_test/use_case_test.dart | 6 +++++- .../test/amplify_storage_s3_dart_test.dart | 2 +- .../test/platform_impl/download_file_io_test.dart | 2 +- 5 files changed, 23 insertions(+), 8 deletions(-) diff --git a/packages/storage/amplify_storage_s3/example/integration_test/content_type_infer/content_type_infer_html.dart b/packages/storage/amplify_storage_s3/example/integration_test/content_type_infer/content_type_infer_html.dart index 8ea8846d94..6337a9e599 100644 --- a/packages/storage/amplify_storage_s3/example/integration_test/content_type_infer/content_type_infer_html.dart +++ b/packages/storage/amplify_storage_s3/example/integration_test/content_type_infer/content_type_infer_html.dart @@ -39,7 +39,11 @@ void testContentTypeInferTest({ tearDownAll(() async { await Amplify.Storage.removeMany( paths: testUploadKeys - .map((key) => StoragePath.fromString('private/$key')) + .map( + (key) => StoragePath.withIdentityId( + (identityId) => 'private/$identityId/$key', + ), + ) .toList(), ).result; }); @@ -53,7 +57,9 @@ void testContentTypeInferTest({ final result = await s3Plugin .uploadFile( localFile: file, - path: StoragePath.fromString('private/${testUploadKeys[index]}'), + path: StoragePath.withIdentityId( + (identityId) => 'private/$identityId/${testUploadKeys[index]}', + ), options: const StorageUploadFileOptions( pluginOptions: S3UploadFilePluginOptions( getProperties: true, diff --git a/packages/storage/amplify_storage_s3/example/integration_test/content_type_infer/content_type_infer_io.dart b/packages/storage/amplify_storage_s3/example/integration_test/content_type_infer/content_type_infer_io.dart index d56b925f56..1dc0627c38 100644 --- a/packages/storage/amplify_storage_s3/example/integration_test/content_type_infer/content_type_infer_io.dart +++ b/packages/storage/amplify_storage_s3/example/integration_test/content_type_infer/content_type_infer_io.dart @@ -35,7 +35,11 @@ void testContentTypeInferTest({ tearDownAll(() async { await Amplify.Storage.removeMany( paths: testUploadKeys - .map((key) => StoragePath.fromString('private/$key')) + .map( + (key) => StoragePath.withIdentityId( + (identityId) => 'private/$identityId/$key', + ), + ) .toList(), ).result; }); @@ -50,8 +54,9 @@ void testContentTypeInferTest({ final result = await s3Plugin .uploadFile( localFile: file, - path: StoragePath.fromString( - '/private/${testUploadKeys[index]}', + path: StoragePath.withIdentityId( + (identityId) => + 'private/$identityId/${testUploadKeys[index]}', ), options: const StorageUploadFileOptions( pluginOptions: S3UploadFilePluginOptions( diff --git a/packages/storage/amplify_storage_s3/example/integration_test/use_case_test.dart b/packages/storage/amplify_storage_s3/example/integration_test/use_case_test.dart index 1ef9fa2b82..d3811054a3 100644 --- a/packages/storage/amplify_storage_s3/example/integration_test/use_case_test.dart +++ b/packages/storage/amplify_storage_s3/example/integration_test/use_case_test.dart @@ -766,7 +766,11 @@ void main() { // Clean up files from this test. await Amplify.Storage.removeMany( paths: uploadedKeys - .map((key) => StoragePath.fromString('private/$key')) + .map( + (key) => StoragePath.withIdentityId( + (identityId) => 'private/$identityId/$key', + ), + ) .toList(), ).result; }); diff --git a/packages/storage/amplify_storage_s3_dart/test/amplify_storage_s3_dart_test.dart b/packages/storage/amplify_storage_s3_dart/test/amplify_storage_s3_dart_test.dart index 1e52ce4fd2..2c679f23d8 100644 --- a/packages/storage/amplify_storage_s3_dart/test/amplify_storage_s3_dart_test.dart +++ b/packages/storage/amplify_storage_s3_dart/test/amplify_storage_s3_dart_test.dart @@ -456,7 +456,7 @@ void main() { registerFallbackValue(const StoragePath.fromString('public/$testKey')); registerFallbackValue( StoragePathWithIdentityId( - (identityId) => '/private/$identityId/$testKey', + (identityId) => 'private/$identityId/$testKey', ), ); }); diff --git a/packages/storage/amplify_storage_s3_dart/test/platform_impl/download_file_io_test.dart b/packages/storage/amplify_storage_s3_dart/test/platform_impl/download_file_io_test.dart index 4954f966f3..68c469fdd8 100644 --- a/packages/storage/amplify_storage_s3_dart/test/platform_impl/download_file_io_test.dart +++ b/packages/storage/amplify_storage_s3_dart/test/platform_impl/download_file_io_test.dart @@ -49,7 +49,7 @@ void main() { registerFallbackValue(const StoragePath.fromString('public/$testKey')); registerFallbackValue( StoragePathWithIdentityId( - (identityId) => '/private/$identityId/$testKey', + (identityId) => 'private/$identityId/$testKey', ), );