File tree 1 file changed +19
-0
lines changed
tests/integration_test/firebase_storage
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -391,6 +391,25 @@ void setupReferenceTests() {
391
391
expect (fullMetadata.customMetadata! ['foo' ], 'bar' );
392
392
});
393
393
394
+ test ('delete metadata' , () async {
395
+ Reference ref = storage.ref ('flutter-tests' ).child ('flt-ok.txt' );
396
+ FullMetadata fullMetadata = await ref
397
+ .updateMetadata (SettableMetadata (customMetadata: {'foo' : 'bar' }));
398
+ expect (fullMetadata.customMetadata! ['foo' ], 'bar' );
399
+
400
+ fullMetadata = await ref.updateMetadata (
401
+ SettableMetadata (
402
+ customMetadata: {},
403
+ ),
404
+ );
405
+ expect (fullMetadata.customMetadata! ['foo' ], isNull);
406
+
407
+ // Setting it again
408
+ fullMetadata = await ref
409
+ .updateMetadata (SettableMetadata (customMetadata: {'foo' : 'bar2' }));
410
+ expect (fullMetadata.customMetadata! ['foo' ], 'bar2' );
411
+ });
412
+
394
413
test ('errors if property does not exist' , () async {
395
414
Reference ref = storage.ref ('flutter-tests/iDoNotExist.jpeg' );
396
415
You can’t perform that action at this time.
0 commit comments