File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -89,5 +89,26 @@ void main() {
89
89
expect (find.byType (IntroPage ), findsNothing);
90
90
expect (find.byType (HomePage ), findsNothing);
91
91
});
92
+
93
+ testWidgets (
94
+ 'Navigation Rail index should update when icon button is pressed' ,
95
+ (tester) async {
96
+ await tester.pumpWidget (
97
+ const ProviderScope (
98
+ child: MaterialApp (
99
+ home: Dashboard (),
100
+ ),
101
+ ),
102
+ );
103
+
104
+ // Tap on the Intro icon
105
+ await tester.tap (find.byIcon (Icons .help_outline));
106
+ await tester.pump ();
107
+
108
+ // Verify that the navRailIndexStateProvider is updated
109
+ final dashboard = tester.element (find.byType (Dashboard ));
110
+ final container = ProviderScope .containerOf (dashboard);
111
+ expect (container.read (navRailIndexStateProvider), 1 );
112
+ });
92
113
});
93
114
}
You can’t perform that action at this time.
0 commit comments