halkyon/halkyon_learn_flutter/test/support/loaded_maps.dart

13 lines
540 B
Dart
Raw Normal View History

import 'package:flutter_test/flutter_test.dart';
import 'package:halkyon_learn_flutter/src/feature/geo_map/data/geo_map_repository.dart';
/// The bundled maps, read already: reading an asset is real input, which a
/// widget test's fake clock never lets finish, so it happens outside it and
/// the app gets this repository (`testDependencies(maps: ...)`).
Future<GeoMapRepository> loadedMaps(WidgetTester tester) async {
final maps = GeoMapRepository();
await tester.runAsync(() async {
await maps.atlas();
});
return maps;
}