Skip to content

Commit 7ec8df3

Browse files
authored
test: add onObjectMetadataUpdated tests (#49)
1 parent 2c7d129 commit 7ec8df3

File tree

2 files changed

+280
-115
lines changed

2 files changed

+280
-115
lines changed

test/e2e/helpers/storage_client.dart

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -76,28 +76,6 @@ class StorageClient {
7676
return jsonDecode(response.body) as Map<String, dynamic>;
7777
}
7878

79-
/// Enables object versioning on the bucket.
80-
///
81-
/// When versioning is enabled, overwriting an object archives the old version,
82-
/// which triggers the `onObjectArchived` event.
83-
Future<void> enableVersioning() async {
84-
final url = Uri.parse('$baseUrl/storage/v1/b/$bucket');
85-
86-
final response = await _client.patch(
87-
url,
88-
headers: {'Content-Type': 'application/json'},
89-
body: jsonEncode({
90-
'versioning': {'enabled': true},
91-
}),
92-
);
93-
94-
if (response.statusCode != 200) {
95-
throw StorageException(
96-
'Failed to enable versioning: ${response.statusCode} ${response.body}',
97-
);
98-
}
99-
}
100-
10179
/// Closes the HTTP client.
10280
void close() {
10381
_client.close();

0 commit comments

Comments
 (0)