test: Add basic widget tests for MyDietsTab and MyDietWidget, and integration tests for create_diet.

This commit is contained in:
mso7nueh
2026-01-28 18:16:24 +03:00
parent 2d7407ce99
commit a1c0c2694b
2 changed files with 4 additions and 4 deletions

View File

@@ -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));
});
});
}

View File

@@ -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 {