diff --git a/packages/neon/neon_dashboard/pubspec.yaml b/packages/neon/neon_dashboard/pubspec.yaml index 615d025c..6be0c844 100644 --- a/packages/neon/neon_dashboard/pubspec.yaml +++ b/packages/neon/neon_dashboard/pubspec.yaml @@ -26,6 +26,7 @@ dependencies: dev_dependencies: build_runner: ^2.4.6 built_collection: ^5.1.1 + flutter_cache_manager: ^3.3.1 flutter_test: sdk: flutter go_router_builder: ^2.3.4 diff --git a/packages/neon/neon_dashboard/test/widget_test.dart b/packages/neon/neon_dashboard/test/widget_test.dart index c05d5ddb..7a3f7b5a 100644 --- a/packages/neon/neon_dashboard/test/widget_test.dart +++ b/packages/neon/neon_dashboard/test/widget_test.dart @@ -1,5 +1,6 @@ import 'package:built_collection/built_collection.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_cache_manager/flutter_cache_manager.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mocktail/mocktail.dart'; import 'package:neon/blocs.dart'; @@ -16,6 +17,8 @@ import 'package:rxdart/rxdart.dart'; class MockAccountsBloc extends Mock implements AccountsBloc {} +class MockCacheManager extends Mock implements DefaultCacheManager {} + Widget wrapWidget(final AccountsBloc accountsBloc, final Widget child) => MaterialApp( localizationsDelegates: DashboardLocalizations.localizationsDelegates, supportedLocales: DashboardLocalizations.supportedLocales, @@ -29,6 +32,8 @@ Widget wrapWidget(final AccountsBloc accountsBloc, final Widget child) => Materi ); void main() { + NeonCachedImage.cacheManager = MockCacheManager(); + final accountsBloc = MockAccountsBloc(); when(() => accountsBloc.activeAccount).thenAnswer( (final invocation) => BehaviorSubject.seeded(