fixed possible lockups on app start
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:marianum_mobile/storage/hydrated_storage_bootstrap.dart';
|
||||
|
||||
void main() {
|
||||
test('InMemoryStorage round-trips, deletes and clears', () async {
|
||||
final storage = InMemoryStorage();
|
||||
expect(storage.read('a'), isNull);
|
||||
|
||||
await storage.write('a', {'x': 1});
|
||||
await storage.write('b', 'two');
|
||||
expect(storage.read('a'), {'x': 1});
|
||||
expect(storage.read('b'), 'two');
|
||||
|
||||
await storage.delete('a');
|
||||
expect(storage.read('a'), isNull);
|
||||
expect(storage.read('b'), 'two');
|
||||
|
||||
await storage.clear();
|
||||
expect(storage.read('b'), isNull);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user