forked from eatvio/eatvio_app
test: Add basic widget tests for MyDietsTab and MyDietWidget, and integration tests for create_diet.
This commit is contained in:
@@ -326,7 +326,7 @@ void main() {
|
||||
expect(find.byType(DietTypeChoiceWidget), findsOneWidget);
|
||||
expect(find.byType(DietImagePickerWidget), findsOneWidget);
|
||||
// Action buttons
|
||||
expect(find.byType(CustomOutlinedButton), findsNWidgets(3));
|
||||
expect(find.byType(CustomOutlinedButton), findsNWidgets(2));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ void main() {
|
||||
|
||||
// Assert
|
||||
expect(find.byType(MyDietsTab), findsOneWidget);
|
||||
expect(find.byType(AnimatedOptionButton), findsNWidgets(3));
|
||||
expect(find.byType(AnimatedOptionButton), findsNWidgets(2));
|
||||
});
|
||||
|
||||
testWidgets('should handle tab selection in MyDietsTab', (WidgetTester tester) async {
|
||||
@@ -119,7 +119,7 @@ void main() {
|
||||
|
||||
// Act - Find and tap the second tab
|
||||
final tabButtons = find.byType(AnimatedOptionButton);
|
||||
expect(tabButtons, findsNWidgets(3));
|
||||
expect(tabButtons, findsNWidgets(2));
|
||||
|
||||
// Tap the second tab (index 1)
|
||||
await tester.tap(tabButtons.at(1));
|
||||
@@ -221,7 +221,7 @@ void main() {
|
||||
|
||||
// Assert
|
||||
expect(find.byType(MyDietsTab), findsOneWidget);
|
||||
expect(find.byType(AnimatedOptionButton), findsNWidgets(3));
|
||||
expect(find.byType(AnimatedOptionButton), findsNWidgets(2));
|
||||
});
|
||||
|
||||
testWidgets('should handle MyDietsTab additionalOnTap callback', (WidgetTester tester) async {
|
||||
|
||||
Reference in New Issue
Block a user