diff --git a/test/Backend/favorite_actions_test.dart b/test/Backend/favorite_actions_test.dart index 3cdadc38..a1ca9729 100644 --- a/test/Backend/favorite_actions_test.dart +++ b/test/Backend/favorite_actions_test.dart @@ -1,6 +1,9 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_test/flutter_test.dart' as flTest; import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/mockito.dart'; +import 'package:plugin_platform_interface/plugin_platform_interface.dart'; +import 'package:quick_actions_platform_interface/quick_actions_platform_interface.dart'; import 'package:tail_app/Backend/Definitions/Action/base_action.dart'; import 'package:tail_app/Backend/LoggingWrappers.dart'; import 'package:tail_app/Backend/favorite_actions.dart'; @@ -12,6 +15,7 @@ import '../testing_utils/hive_utils.dart'; void main() { setUp(() async { flTest.TestWidgetsFlutterBinding.ensureInitialized(); + QuickActionsPlatform.instance = MockQuickActionsPlatform(); await setupHive(); }); tearDown(() async { @@ -42,3 +46,14 @@ void main() { expect(HiveProxy.getAll(favoriteActionsBox).length, 0); }); } + +class MockQuickActionsPlatform extends Mock with MockPlatformInterfaceMixin implements QuickActionsPlatform { + @override + Future clearShortcutItems() async => super.noSuchMethod(Invocation.method(#clearShortcutItems, [])); + + @override + Future initialize(QuickActionHandler? handler) async => super.noSuchMethod(Invocation.method(#initialize, [handler])); + + @override + Future setShortcutItems(List? items) async => super.noSuchMethod(Invocation.method(#setShortcutItems, [items])); +}