From bd291404d887822eae99bf48c274a9ff1bc0f95d Mon Sep 17 00:00:00 2001 From: vyPal <66716025+vyPal@users.noreply.github.com> Date: Mon, 11 Mar 2024 13:12:33 +0100 Subject: [PATCH] Fix message page test --- android/app/build.gradle | 2 +- integration_test/app_test.dart | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index d241130..50d5baa 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -58,7 +58,7 @@ android { versionName flutterVersionName targetSdkVersion 33 minSdkVersion 21 - compileSdkVersion 33 + compileSdkVersion 34 multiDexEnabled true } diff --git a/integration_test/app_test.dart b/integration_test/app_test.dart index ce4b722..fd19d76 100644 --- a/integration_test/app_test.dart +++ b/integration_test/app_test.dart @@ -82,24 +82,25 @@ void main() { expect(find.text("Messages"), findsWidgets); expect(find.byType(Card), findsWidgets); }); - testWidgets('Test Message page', (tester) async { - await prep(tester, username, password, name, false, "", true, token); + await prep(tester, username, password, name, false, "", false, ""); await tester.tap(find.byType(NavigationDestination).at(2)); - await tester.pump(const Duration(seconds: 1)); await pumpUntilFound(tester, find.text("Messages")); expect(find.text("Messages"), findsWidgets); - expect(find.byType(Card), findsWidgets); - - await tester.tap(find.byType(InkWell).at(0)); + Finder f = find.byWidgetPredicate((widget) => + widget is Icon && + widget.size == 18 && + widget.icon == Icons.arrow_right_rounded); + await pumpUntilFound(tester, f); + expect(f, findsWidgets); + + await tester.tap(f.at(0)); await tester.pump(const Duration(seconds: 1)); - await pumpUntilFound(tester, - find.byWidget(const Icon(Icons.arrow_right_rounded, size: 18))); - expect(find.byWidget(const Icon(Icons.arrow_right_rounded, size: 18)), - findsOneWidget); + await pumpUntilFound(tester, f); + expect(f, findsOneWidget); expect(find.byType(Card), findsWidgets); });