Skip to content

Commit

Permalink
chore: update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan-Nelson committed Mar 25, 2024
1 parent b9d778f commit 434a57a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand All @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ void main() {
registerFallbackValue(const StoragePath.fromString('public/$testKey'));
registerFallbackValue(
StoragePathWithIdentityId(
(identityId) => '/private/$identityId/$testKey',
(identityId) => 'private/$identityId/$testKey',
),
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void main() {
registerFallbackValue(const StoragePath.fromString('public/$testKey'));
registerFallbackValue(
StoragePathWithIdentityId(
(identityId) => '/private/$identityId/$testKey',
(identityId) => 'private/$identityId/$testKey',
),
);

Expand Down

0 comments on commit 434a57a

Please sign in to comment.