From 65df45e09196391683aecd593b4c32e0c85dd32f Mon Sep 17 00:00:00 2001 From: Adam Velebil Date: Fri, 20 Oct 2023 11:38:36 +0200 Subject: [PATCH] refactor widget tests --- test/android_settings_page_test.dart | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/test/android_settings_page_test.dart b/test/android_settings_page_test.dart index efd74a00..118b532c 100644 --- a/test/android_settings_page_test.dart +++ b/test/android_settings_page_test.dart @@ -352,12 +352,7 @@ void main() { testWidgets('NFC options visible on device with NFC support', (WidgetTester tester) async { - SharedPreferences sharedPrefs = await SharedPreferences.getInstance(); - - await tester.pumpWidget(await androidWidget( - sharedPrefs: sharedPrefs, - hasNfcSupport: true, - )); + await tester.pumpWidget(await androidWidget(hasNfcSupport: true)); expect(find.byKey(android_keys.nfcTapSetting), findsOneWidget); expect(find.byKey(android_keys.nfcKeyboardLayoutSetting), findsOneWidget); @@ -367,12 +362,7 @@ void main() { testWidgets('NFC options hidden on device without NFC support', (WidgetTester tester) async { - SharedPreferences sharedPrefs = await SharedPreferences.getInstance(); - - await tester.pumpWidget(await androidWidget( - sharedPrefs: sharedPrefs, - hasNfcSupport: false, - )); + await tester.pumpWidget(await androidWidget(hasNfcSupport: false)); expect(find.byKey(android_keys.nfcTapSetting), findsNothing); expect(find.byKey(android_keys.nfcKeyboardLayoutSetting), findsNothing);