From 966f99903cc158135145577f80861648b486da22 Mon Sep 17 00:00:00 2001 From: rohansen856 Date: Wed, 11 Dec 2024 18:55:25 +0530 Subject: [PATCH] tests: added tests for files under lib/tour folder --- test/tour/details_page_tour_test.dart | 141 +++++++++++++++ test/tour/filter_drawer_tour_test.dart | 170 ++++++++++++++++++ test/tour/home_page_tour_test.dart | 165 +++++++++++++++++ .../manage_task_server_page_tour_test.dart | 146 +++++++++++++++ test/tour/profile_page_tour_test.dart | 104 +++++++++++ test/tour/reports_page_tour_test.dart | 106 +++++++++++ 6 files changed, 832 insertions(+) create mode 100644 test/tour/details_page_tour_test.dart create mode 100644 test/tour/filter_drawer_tour_test.dart create mode 100644 test/tour/home_page_tour_test.dart create mode 100644 test/tour/manage_task_server_page_tour_test.dart create mode 100644 test/tour/profile_page_tour_test.dart create mode 100644 test/tour/reports_page_tour_test.dart diff --git a/test/tour/details_page_tour_test.dart b/test/tour/details_page_tour_test.dart new file mode 100644 index 00000000..1f31272f --- /dev/null +++ b/test/tour/details_page_tour_test.dart @@ -0,0 +1,141 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/mockito.dart'; +import 'package:taskwarrior/app/tour/details_page_tour.dart'; +import 'package:tutorial_coach_mark/tutorial_coach_mark.dart'; + +class MockTutorialCoachMarkController extends Mock + implements TutorialCoachMarkController {} + +void main() { + group('Details Page Tour', () { + late GlobalKey dueKey; + late GlobalKey waitKey; + late GlobalKey untilKey; + late GlobalKey priorityKey; + final controller = MockTutorialCoachMarkController(); + + setUp(() { + dueKey = GlobalKey(); + waitKey = GlobalKey(); + untilKey = GlobalKey(); + priorityKey = GlobalKey(); + }); + + test('should return a list of TargetFocus with correct properties', () { + final targets = addDetailsPage( + dueKey: dueKey, + waitKey: waitKey, + untilKey: untilKey, + priorityKey: priorityKey, + ); + + expect(targets.length, 4); + + expect(targets[0].keyTarget, dueKey); + expect(targets[0].alignSkip, Alignment.topRight); + expect(targets[0].shape, ShapeLightFocus.RRect); + + expect(targets[1].keyTarget, waitKey); + expect(targets[1].alignSkip, Alignment.topRight); + expect(targets[1].shape, ShapeLightFocus.RRect); + + expect(targets[2].keyTarget, untilKey); + expect(targets[2].alignSkip, Alignment.topRight); + expect(targets[2].shape, ShapeLightFocus.RRect); + + expect(targets[3].keyTarget, priorityKey); + expect(targets[3].alignSkip, Alignment.topRight); + expect(targets[3].shape, ShapeLightFocus.RRect); + }); + + testWidgets('should render correct text for dueKey TargetContent', + (WidgetTester tester) async { + final targets = addDetailsPage( + dueKey: dueKey, + waitKey: waitKey, + untilKey: untilKey, + priorityKey: priorityKey, + ); + + final content = targets[0].contents!.first; + + await tester.pumpWidget(MaterialApp( + home: Builder( + builder: (context) => content.builder!(context, controller), + ), + )); + + expect( + find.text("This signifies the due date of the task"), findsOneWidget); + }); + + testWidgets('should render correct text for waitKey TargetContent', + (WidgetTester tester) async { + final targets = addDetailsPage( + dueKey: dueKey, + waitKey: waitKey, + untilKey: untilKey, + priorityKey: priorityKey, + ); + + final content = targets[1].contents!.first; + + await tester.pumpWidget(MaterialApp( + home: Builder( + builder: (context) => content.builder!(context, controller), + ), + )); + + expect( + find.text( + "This signifies the waiting date of the task \n Task will be visible after this date"), + findsOneWidget, + ); + }); + + testWidgets('should render correct text for untilKey TargetContent', + (WidgetTester tester) async { + final targets = addDetailsPage( + dueKey: dueKey, + waitKey: waitKey, + untilKey: untilKey, + priorityKey: priorityKey, + ); + + final content = targets[2].contents!.first; + + await tester.pumpWidget(MaterialApp( + home: Builder( + builder: (context) => content.builder!(context, controller), + ), + )); + + expect(find.text("This shows the last date of the task"), findsOneWidget); + }); + + testWidgets('should render correct text for priorityKey TargetContent', + (WidgetTester tester) async { + final targets = addDetailsPage( + dueKey: dueKey, + waitKey: waitKey, + untilKey: untilKey, + priorityKey: priorityKey, + ); + + final content = targets[3].contents!.first; + + await tester.pumpWidget(MaterialApp( + home: Builder( + builder: (context) => content.builder!(context, controller), + ), + )); + + expect( + find.text( + "This is the priority of the Tasks \n L -> Low \n M -> Medium \n H -> Hard"), + findsOneWidget, + ); + }); + }); +} diff --git a/test/tour/filter_drawer_tour_test.dart b/test/tour/filter_drawer_tour_test.dart new file mode 100644 index 00000000..e04fed92 --- /dev/null +++ b/test/tour/filter_drawer_tour_test.dart @@ -0,0 +1,170 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/mockito.dart'; +import 'package:taskwarrior/app/tour/filter_drawer_tour.dart'; +import 'package:tutorial_coach_mark/tutorial_coach_mark.dart'; + +class MockTutorialCoachMarkController extends Mock + implements TutorialCoachMarkController {} + +void main() { + group('Filter Drawer Page Tour', () { + late GlobalKey statusKey; + late GlobalKey projectsKey; + late GlobalKey projectsKeyTaskc; + late GlobalKey filterTagKey; + late GlobalKey sortByKey; + final controller = MockTutorialCoachMarkController(); + + setUp(() { + statusKey = GlobalKey(); + projectsKey = GlobalKey(); + projectsKeyTaskc = GlobalKey(); + filterTagKey = GlobalKey(); + sortByKey = GlobalKey(); + }); + + test('should return a list of TargetFocus with correct properties', () { + final targets = filterDrawer( + statusKey: statusKey, + projectsKey: projectsKey, + projectsKeyTaskc: projectsKeyTaskc, + filterTagKey: filterTagKey, + sortByKey: sortByKey, + ); + + expect(targets.length, 5); + + expect(targets[0].keyTarget, statusKey); + expect(targets[0].alignSkip, Alignment.topRight); + expect(targets[0].shape, ShapeLightFocus.RRect); + + expect(targets[1].keyTarget, projectsKey); + expect(targets[1].alignSkip, Alignment.topRight); + expect(targets[1].shape, ShapeLightFocus.RRect); + + expect(targets[2].keyTarget, projectsKeyTaskc); + expect(targets[2].alignSkip, Alignment.topRight); + expect(targets[2].shape, ShapeLightFocus.RRect); + + expect(targets[3].keyTarget, filterTagKey); + expect(targets[3].alignSkip, Alignment.topRight); + expect(targets[3].shape, ShapeLightFocus.RRect); + + expect(targets[4].keyTarget, sortByKey); + expect(targets[4].alignSkip, Alignment.topRight); + expect(targets[4].shape, ShapeLightFocus.RRect); + }); + + testWidgets('should render correct text for statusKey TargetContent', + (WidgetTester tester) async { + final targets = filterDrawer( + statusKey: statusKey, + projectsKey: projectsKey, + projectsKeyTaskc: projectsKeyTaskc, + filterTagKey: filterTagKey, + sortByKey: sortByKey, + ); + + final content = targets[0].contents!.first; + + await tester.pumpWidget(MaterialApp( + home: Builder( + builder: (context) => content.builder!(context, controller), + ), + )); + + expect(find.text("Filter tasks based on their completion status"), + findsOneWidget); + }); + + testWidgets('should render correct text for projectsKey TargetContent', + (WidgetTester tester) async { + final targets = filterDrawer( + statusKey: statusKey, + projectsKey: projectsKey, + projectsKeyTaskc: projectsKeyTaskc, + filterTagKey: filterTagKey, + sortByKey: sortByKey, + ); + + final content = targets[1].contents!.first; + + await tester.pumpWidget(MaterialApp( + home: Builder( + builder: (context) => content.builder!(context, controller), + ), + )); + + expect(find.text("Filter tasks based on the projects"), findsOneWidget); + }); + + testWidgets('should render correct text for projectsKeyTaskc TargetContent', + (WidgetTester tester) async { + final targets = filterDrawer( + statusKey: statusKey, + projectsKey: projectsKey, + projectsKeyTaskc: projectsKeyTaskc, + filterTagKey: filterTagKey, + sortByKey: sortByKey, + ); + + final content = targets[2].contents!.first; + + await tester.pumpWidget(MaterialApp( + home: Builder( + builder: (context) => content.builder!(context, controller), + ), + )); + + expect(find.text("Filter tasks based on the projects"), findsOneWidget); + }); + + testWidgets('should render correct text for filterTagKey TargetContent', + (WidgetTester tester) async { + final targets = filterDrawer( + statusKey: statusKey, + projectsKey: projectsKey, + projectsKeyTaskc: projectsKeyTaskc, + filterTagKey: filterTagKey, + sortByKey: sortByKey, + ); + + final content = targets[3].contents!.first; + + await tester.pumpWidget(MaterialApp( + home: Builder( + builder: (context) => content.builder!(context, controller), + ), + )); + + expect(find.text("Toggle between AND and OR tag union types"), + findsOneWidget); + }); + + testWidgets('should render correct text for sortByKey TargetContent', + (WidgetTester tester) async { + final targets = filterDrawer( + statusKey: statusKey, + projectsKey: projectsKey, + projectsKeyTaskc: projectsKeyTaskc, + filterTagKey: filterTagKey, + sortByKey: sortByKey, + ); + + final content = targets[4].contents!.first; + + await tester.pumpWidget(MaterialApp( + home: Builder( + builder: (context) => content.builder!(context, controller), + ), + )); + + expect( + find.text( + "Sort tasks based on time of creation, urgency, due date, start date, etc."), + findsOneWidget, + ); + }); + }); +} diff --git a/test/tour/home_page_tour_test.dart b/test/tour/home_page_tour_test.dart new file mode 100644 index 00000000..6a360e9f --- /dev/null +++ b/test/tour/home_page_tour_test.dart @@ -0,0 +1,165 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/mockito.dart'; +import 'package:taskwarrior/app/tour/home_page_tour.dart'; +import 'package:tutorial_coach_mark/tutorial_coach_mark.dart'; + +class MockTutorialCoachMarkController extends Mock + implements TutorialCoachMarkController {} + +void main() { + group('Home Page Tour', () { + late GlobalKey addKey; + late GlobalKey searchKey; + late GlobalKey filterKey; + late GlobalKey menuKey; + late GlobalKey refreshKey; + final controller = MockTutorialCoachMarkController(); + + setUp(() { + addKey = GlobalKey(); + searchKey = GlobalKey(); + filterKey = GlobalKey(); + menuKey = GlobalKey(); + refreshKey = GlobalKey(); + }); + + test('should return a list of TargetFocus with correct properties', () { + final targets = addTargetsPage( + addKey: addKey, + searchKey: searchKey, + filterKey: filterKey, + menuKey: menuKey, + refreshKey: refreshKey, + ); + + expect(targets.length, 5); + + expect(targets[0].keyTarget, addKey); + expect(targets[0].alignSkip, Alignment.topRight); + expect(targets[0].shape, ShapeLightFocus.Circle); + + expect(targets[1].keyTarget, searchKey); + expect(targets[1].alignSkip, Alignment.topRight); + expect(targets[1].shape, ShapeLightFocus.Circle); + + expect(targets[2].keyTarget, refreshKey); + expect(targets[2].alignSkip, Alignment.topCenter); + expect(targets[2].shape, ShapeLightFocus.Circle); + + expect(targets[3].keyTarget, filterKey); + expect(targets[3].alignSkip, Alignment.topCenter); + expect(targets[3].shape, ShapeLightFocus.Circle); + + expect(targets[4].keyTarget, menuKey); + expect(targets[4].alignSkip, Alignment.bottomRight); + expect(targets[4].shape, ShapeLightFocus.Circle); + }); + + testWidgets('should render correct text for addKey TargetContent', + (WidgetTester tester) async { + final targets = addTargetsPage( + addKey: addKey, + searchKey: searchKey, + filterKey: filterKey, + menuKey: menuKey, + refreshKey: refreshKey, + ); + + final content = targets[0].contents!.first; + + await tester.pumpWidget(MaterialApp( + home: Builder( + builder: (context) => content.builder!(context, controller), + ), + )); + + expect(find.text("Add a new task"), findsOneWidget); + }); + + testWidgets('should render correct text for searchKey TargetContent', + (WidgetTester tester) async { + final targets = addTargetsPage( + addKey: addKey, + searchKey: searchKey, + filterKey: filterKey, + menuKey: menuKey, + refreshKey: refreshKey, + ); + + final content = targets[1].contents!.first; + + await tester.pumpWidget(MaterialApp( + home: Builder( + builder: (context) => content.builder!(context, controller), + ), + )); + + expect(find.text("Search for tasks"), findsOneWidget); + }); + + testWidgets('should render correct text for refreshKey TargetContent', + (WidgetTester tester) async { + final targets = addTargetsPage( + addKey: addKey, + searchKey: searchKey, + filterKey: filterKey, + menuKey: menuKey, + refreshKey: refreshKey, + ); + + final content = targets[2].contents!.first; + + await tester.pumpWidget(MaterialApp( + home: Builder( + builder: (context) => content.builder!(context, controller), + ), + )); + + expect(find.text("Refresh or sync your tasks"), findsOneWidget); + }); + + testWidgets('should render correct text for filterKey TargetContent', + (WidgetTester tester) async { + final targets = addTargetsPage( + addKey: addKey, + searchKey: searchKey, + filterKey: filterKey, + menuKey: menuKey, + refreshKey: refreshKey, + ); + + final content = targets[3].contents!.first; + + await tester.pumpWidget(MaterialApp( + home: Builder( + builder: (context) => content.builder!(context, controller), + ), + )); + + expect(find.text("Add filters to sort your tasks and projects"), + findsOneWidget); + }); + + testWidgets('should render correct text for menuKey TargetContent', + (WidgetTester tester) async { + final targets = addTargetsPage( + addKey: addKey, + searchKey: searchKey, + filterKey: filterKey, + menuKey: menuKey, + refreshKey: refreshKey, + ); + + final content = targets[4].contents!.first; + + await tester.pumpWidget(MaterialApp( + home: Builder( + builder: (context) => content.builder!(context, controller), + ), + )); + + expect(find.text("Access additional settings here"), findsOneWidget); + }); + }); +} diff --git a/test/tour/manage_task_server_page_tour_test.dart b/test/tour/manage_task_server_page_tour_test.dart new file mode 100644 index 00000000..117a7b2f --- /dev/null +++ b/test/tour/manage_task_server_page_tour_test.dart @@ -0,0 +1,146 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/mockito.dart'; +import 'package:taskwarrior/app/tour/manage_task_server_page_tour.dart'; +import 'package:tutorial_coach_mark/tutorial_coach_mark.dart'; + +class MockTutorialCoachMarkController extends Mock + implements TutorialCoachMarkController {} + +void main() { + group('Manage Task Server Page Tour', () { + late GlobalKey configureTaskRC; + late GlobalKey configureYourCertificate; + late GlobalKey configureTaskServerKey; + late GlobalKey configureServerCertificate; + final controller = MockTutorialCoachMarkController(); + + setUp(() { + configureTaskRC = GlobalKey(); + configureYourCertificate = GlobalKey(); + configureTaskServerKey = GlobalKey(); + configureServerCertificate = GlobalKey(); + }); + + test('should return a list of TargetFocus with correct properties', () { + final targets = addManageTaskServerPage( + configureTaskRC: configureTaskRC, + configureYourCertificate: configureYourCertificate, + configureTaskServerKey: configureTaskServerKey, + configureServerCertificate: configureServerCertificate, + ); + + expect(targets.length, 4); + + expect(targets[0].keyTarget, configureTaskRC); + expect(targets[0].alignSkip, Alignment.topRight); + expect(targets[0].shape, ShapeLightFocus.RRect); + + expect(targets[1].keyTarget, configureYourCertificate); + expect(targets[1].alignSkip, Alignment.topRight); + expect(targets[1].shape, ShapeLightFocus.RRect); + + expect(targets[2].keyTarget, configureTaskServerKey); + expect(targets[2].alignSkip, Alignment.bottomCenter); + expect(targets[2].shape, ShapeLightFocus.RRect); + + expect(targets[3].keyTarget, configureServerCertificate); + expect(targets[3].alignSkip, Alignment.bottomCenter); + expect(targets[3].shape, ShapeLightFocus.RRect); + }); + + testWidgets('should render correct text for configureTaskRC TargetContent', + (WidgetTester tester) async { + final targets = addManageTaskServerPage( + configureTaskRC: configureTaskRC, + configureYourCertificate: configureYourCertificate, + configureTaskServerKey: configureTaskServerKey, + configureServerCertificate: configureServerCertificate, + ); + + final content = targets[0].contents!.first; + + await tester.pumpWidget(MaterialApp( + home: Builder( + builder: (context) => content.builder!(context, controller), + ), + )); + + expect( + find.text("Select the file named taskrc here or paste it's content"), + findsOneWidget); + }); + + testWidgets( + 'should render correct text for configureYourCertificate TargetContent', + (WidgetTester tester) async { + final targets = addManageTaskServerPage( + configureTaskRC: configureTaskRC, + configureYourCertificate: configureYourCertificate, + configureTaskServerKey: configureTaskServerKey, + configureServerCertificate: configureServerCertificate, + ); + + final content = targets[1].contents!.first; + + await tester.pumpWidget(MaterialApp( + home: Builder( + builder: (context) => content.builder!(context, controller), + ), + )); + + expect( + find.text( + "Select file similarly named like .com.cert.pem here"), + findsOneWidget); + }); + + testWidgets( + 'should render correct text for configureTaskServerKey TargetContent', + (WidgetTester tester) async { + final targets = addManageTaskServerPage( + configureTaskRC: configureTaskRC, + configureYourCertificate: configureYourCertificate, + configureTaskServerKey: configureTaskServerKey, + configureServerCertificate: configureServerCertificate, + ); + + final content = targets[2].contents!.first; + + await tester.pumpWidget(MaterialApp( + home: Builder( + builder: (context) => content.builder!(context, controller), + ), + )); + + expect( + find.text( + "Select file similarly named like .key.pem here"), + findsOneWidget); + }); + + testWidgets( + 'should render correct text for configureServerCertificate TargetContent', + (WidgetTester tester) async { + final targets = addManageTaskServerPage( + configureTaskRC: configureTaskRC, + configureYourCertificate: configureYourCertificate, + configureTaskServerKey: configureTaskServerKey, + configureServerCertificate: configureServerCertificate, + ); + + final content = targets[3].contents!.first; + + await tester.pumpWidget(MaterialApp( + home: Builder( + builder: (context) => content.builder!(context, controller), + ), + )); + + expect( + find.text( + "Select file similarly named like letsencrypt_root_cert.pem here"), + findsOneWidget); + }); + }); +} diff --git a/test/tour/profile_page_tour_test.dart b/test/tour/profile_page_tour_test.dart new file mode 100644 index 00000000..35a6e305 --- /dev/null +++ b/test/tour/profile_page_tour_test.dart @@ -0,0 +1,104 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/mockito.dart'; +import 'package:taskwarrior/app/tour/profile_page_tour.dart'; +import 'package:tutorial_coach_mark/tutorial_coach_mark.dart'; + +class MockTutorialCoachMarkController extends Mock + implements TutorialCoachMarkController {} + +void main() { + group('Profile Page Tour', () { + late GlobalKey currentProfileKey; + late GlobalKey addNewProfileKey; + late GlobalKey manageSelectedProfileKey; + final controller = MockTutorialCoachMarkController(); + + setUp(() { + currentProfileKey = GlobalKey(); + addNewProfileKey = GlobalKey(); + manageSelectedProfileKey = GlobalKey(); + }); + + test('should return a list of TargetFocus with correct properties', () { + final targets = addProfilePage( + currentProfileKey: currentProfileKey, + addNewProfileKey: addNewProfileKey, + manageSelectedProfileKey: manageSelectedProfileKey, + ); + + expect(targets.length, 3); + + expect(targets[0].keyTarget, currentProfileKey); + expect(targets[0].alignSkip, Alignment.topRight); + expect(targets[0].shape, ShapeLightFocus.RRect); + + expect(targets[1].keyTarget, manageSelectedProfileKey); + expect(targets[1].alignSkip, Alignment.topRight); + expect(targets[1].shape, ShapeLightFocus.RRect); + + expect(targets[2].keyTarget, addNewProfileKey); + expect(targets[2].alignSkip, Alignment.topRight); + expect(targets[2].shape, ShapeLightFocus.RRect); + }); + + testWidgets( + 'should render correct text for currentProfileKey TargetContent', + (WidgetTester tester) async { + final targets = addProfilePage( + currentProfileKey: currentProfileKey, + addNewProfileKey: addNewProfileKey, + manageSelectedProfileKey: manageSelectedProfileKey, + ); + + final content = targets[0].contents!.first; + + await tester.pumpWidget(MaterialApp( + home: Builder( + builder: (context) => content.builder!(context, controller), + ), + )); + + expect(find.text("See your current profile here"), findsOneWidget); + }); + + testWidgets( + 'should render correct text for manageSelectedProfileKey TargetContent', + (WidgetTester tester) async { + final targets = addProfilePage( + currentProfileKey: currentProfileKey, + addNewProfileKey: addNewProfileKey, + manageSelectedProfileKey: manageSelectedProfileKey, + ); + + final content = targets[1].contents!.first; + + await tester.pumpWidget(MaterialApp( + home: Builder( + builder: (context) => content.builder!(context, controller), + ), + )); + + expect(find.text("Manage your current profile here"), findsOneWidget); + }); + + testWidgets('should render correct text for addNewProfileKey TargetContent', + (WidgetTester tester) async { + final targets = addProfilePage( + currentProfileKey: currentProfileKey, + addNewProfileKey: addNewProfileKey, + manageSelectedProfileKey: manageSelectedProfileKey, + ); + + final content = targets[2].contents!.first; + + await tester.pumpWidget(MaterialApp( + home: Builder( + builder: (context) => content.builder!(context, controller), + ), + )); + + expect(find.text("Add a new profile here"), findsOneWidget); + }); + }); +} diff --git a/test/tour/reports_page_tour_test.dart b/test/tour/reports_page_tour_test.dart new file mode 100644 index 00000000..60edb1e2 --- /dev/null +++ b/test/tour/reports_page_tour_test.dart @@ -0,0 +1,106 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/mockito.dart'; +import 'package:taskwarrior/app/tour/reports_page_tour.dart'; +import 'package:tutorial_coach_mark/tutorial_coach_mark.dart'; + +class MockTutorialCoachMarkController extends Mock + implements TutorialCoachMarkController {} + +void main() { + group('Reports Page Tour', () { + late GlobalKey dailyKey; + late GlobalKey weeklyKey; + late GlobalKey monthlyKey; + final controller = MockTutorialCoachMarkController(); + + setUp(() { + dailyKey = GlobalKey(); + weeklyKey = GlobalKey(); + monthlyKey = GlobalKey(); + }); + + test('should return a list of TargetFocus with correct properties', () { + final targets = reportsDrawer( + daily: dailyKey, + weekly: weeklyKey, + monthly: monthlyKey, + ); + + expect(targets.length, 3); + + expect(targets[0].keyTarget, dailyKey); + expect(targets[0].alignSkip, Alignment.topRight); + expect(targets[0].shape, ShapeLightFocus.RRect); + expect(targets[0].radius, 10); + + expect(targets[1].keyTarget, weeklyKey); + expect(targets[1].alignSkip, Alignment.topRight); + expect(targets[1].shape, ShapeLightFocus.RRect); + expect(targets[1].radius, 10); + + expect(targets[2].keyTarget, monthlyKey); + expect(targets[2].alignSkip, Alignment.bottomCenter); + expect(targets[2].shape, ShapeLightFocus.RRect); + expect(targets[2].radius, 10); + }); + + testWidgets('should render correct text for dailyKey TargetContent', + (WidgetTester tester) async { + final targets = reportsDrawer( + daily: dailyKey, + weekly: weeklyKey, + monthly: monthlyKey, + ); + + final content = targets[0].contents!.first; + + await tester.pumpWidget(MaterialApp( + home: Builder( + builder: (context) => content.builder!(context, controller), + ), + )); + + expect(find.text("Access your daily task report here"), findsOneWidget); + }); + + testWidgets('should render correct text for weeklyKey TargetContent', + (WidgetTester tester) async { + final targets = reportsDrawer( + daily: dailyKey, + weekly: weeklyKey, + monthly: monthlyKey, + ); + + final content = targets[1].contents!.first; + + await tester.pumpWidget(MaterialApp( + home: Builder( + builder: (context) => content.builder!(context, controller), + ), + )); + + expect(find.text("Access your weekly task reports here"), findsOneWidget); + }); + + testWidgets('should render correct text for monthlyKey TargetContent', + (WidgetTester tester) async { + final targets = reportsDrawer( + daily: dailyKey, + weekly: weeklyKey, + monthly: monthlyKey, + ); + + final content = targets[2].contents!.first; + + await tester.pumpWidget(MaterialApp( + home: Builder( + builder: (context) => content.builder!(context, controller), + ), + )); + + expect( + find.text("Access your monthly task reports here"), findsOneWidget); + }); + }); +}