-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
96 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
54 changes: 54 additions & 0 deletions
54
healthway_app/test/nutricionista_dashboard_screen_test.dart
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:healthway_app/screens_nutricionist/nutritionist_dashboard_screen.dart'; | ||
|
||
void main() { | ||
testWidgets('NutritionistDashboardScreen displays correctly', (WidgetTester tester) async { | ||
// Build the NutritionistDashboardScreen widget. | ||
await tester.pumpWidget(MaterialApp(home: NutritionistDashboardScreen(userData: {},))); | ||
|
||
// Verify if the background color is correct. | ||
final scaffold = tester.widget<Scaffold>(find.byType(Scaffold)); | ||
expect(scaffold.backgroundColor, const Color(0xFFE6F7F8)); | ||
|
||
// Verify if the AppBar widget is present. | ||
expect(find.byType(AppBar), findsOneWidget); | ||
|
||
// Verify if the Icon widget is present. | ||
expect(find.byType(Icon), findsOneWidget); | ||
|
||
// Verify if the Padding widget is present. | ||
expect(find.byType(Padding), findsOneWidget); | ||
|
||
// Verify if the Form widget is present. | ||
expect(find.byType(Form), findsOneWidget); | ||
|
||
// Verify if the TextFormField widget is present. | ||
expect(find.byType(TextFormField), findsNWidgets(2)); | ||
|
||
// Verify if the ElevatedButton widget is present. | ||
expect(find.byType(ElevatedButton), findsOneWidget); | ||
|
||
// Verify if the CircularProgressIndicator widget is present. | ||
expect(find.byType(CircularProgressIndicator), findsNothing); | ||
|
||
// Add more specific tests for the widgets inside the Column as needed. | ||
}); | ||
|
||
testWidgets('NutritionistDashboardScreen displays CircularProgressIndicator when loading', (WidgetTester tester) async { | ||
// Build the NutritionistDashboardScreen widget. | ||
await tester.pumpWidget(MaterialApp(home: NutritionistDashboardScreen(userData: {},))); | ||
|
||
// Verify if the CircularProgressIndicator widget is present. | ||
expect(find.byType(CircularProgressIndicator), findsNothing); | ||
|
||
// Tap the ElevatedButton to simulate a loading state. | ||
await tester.tap(find.byType(ElevatedButton)); | ||
await tester.pump(); | ||
|
||
// Verify if the CircularProgressIndicator widget is present. | ||
expect(find.byType(CircularProgressIndicator), findsOneWidget); | ||
}); | ||
|
||
|
||
} |