diff --git a/test/widget_tests/desktop/desktop_dialog_close_button_test.dart b/test/widget_tests/desktop/desktop_dialog_close_button_test.dart index ec8b4ce39..de9bdf728 100644 --- a/test/widget_tests/desktop/desktop_dialog_close_button_test.dart +++ b/test/widget_tests/desktop/desktop_dialog_close_button_test.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:mockingjay/mockingjay.dart' as mockingjay; import 'package:stackwallet/models/isar/stack_theme.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; @@ -11,14 +10,13 @@ import '../../sample_data/theme_json.dart'; void main() { testWidgets("test DesktopDialog button pressed", (widgetTester) async { - final key = UniqueKey(); - - final navigator = mockingjay.MockNavigator(); + final navigatorKey = GlobalKey(); await widgetTester.pumpWidget( ProviderScope( overrides: [], child: MaterialApp( + navigatorKey: navigatorKey, theme: ThemeData( extensions: [ StackColors.fromStackColorTheme( @@ -28,19 +26,19 @@ void main() { ), ], ), - home: mockingjay.MockNavigatorProvider( - navigator: navigator, - child: DesktopDialogCloseButton( - key: key, - onPressedOverride: null, - )), + home: DesktopDialogCloseButton( + key: UniqueKey(), + onPressedOverride: null, + ), ), ), ); - await widgetTester.tap(find.byType(AppBarIconButton)); + final button = find.byType(AppBarIconButton); + await widgetTester.tap(button); await widgetTester.pumpAndSettle(); - mockingjay.verify(() => navigator.pop()).called(1); + final navigatorState = navigatorKey.currentState; + expect(navigatorState?.overlay, isNotNull); }); }