Created
September 9, 2025 08:29
-
-
Save YonatanKra/9984e00f79661cadf56348989b11c5c6 to your computer and use it in GitHub Desktop.
Flutter widget simple test - approach one
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| testWidgets(‘should display “mock_first” text’, (WidgetTester tester) async { | |
| await tester.pumpWidget( | |
| ChangeNotifierProvider<MyAppState>( | |
| create: (context) => MockAppState(), | |
| child: MaterialApp(home: MyHomePage()), | |
| ), | |
| ); | |
| expect(find.text(‘mock_first’), findsOneWidget); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment