test(registration): Favorite foods and birth date screen test passed

This commit is contained in:
2024-03-13 11:20:27 +03:00
parent 2822238532
commit 77591f4fd2
3 changed files with 109 additions and 1 deletions

View File

@@ -38,7 +38,7 @@ class _FavoriteFoodsScreenState extends State<FavoriteFoodsScreen> {
body: Container(
width: double.maxFinite,
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
child: Column(children: [
child: ListView(children: [
SizedBox(height: 7.v),
Container(
height: 16.v,

View File

@@ -0,0 +1,54 @@
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:eatvio_app/presentation/registration/date_of_birth_screen/date_of_birth_screen.dart';
import 'package:eatvio_app/presentation/registration/date_of_birth_screen/bloc/date_of_birth_bloc.dart';
import 'package:eatvio_app/presentation/registration/date_of_birth_screen/models/date_of_birth_model.dart';
void main() {
group('AdditionalInfoScreen', () {
testWidgets('renders screen in initial state', (WidgetTester tester) async {
final myProfileBloc = DateOfBirthBloc(DateOfBirthState(
dateOfBirthModelObj: DateOfBirthModel(
userRegistrationSheet: UserRegistrationSheet(
name: "name",
firstName: "firstName",
lastName: "lastName",
email: "email",
password: "password",
passwordConfirmation: "passwordConfirmation",
termsAccepted: "termsAccepted",
birthdate: "birthdate",
gender: "gender",
country: "country",
city: "city",
lang: "lang",
weight: "weight",
height: "height",
chestCircumference: 'asdasd',
waistCircumference: "waistCircumference",
hipCircumference: "hipCircumference",
bloodPressureUp: "bloodPressureUp",
bloodPressureDown: "bloodPressureDown",
hasHypo: "hasHypo",
hasHyper: "hasHyper",
aboutAllergy: "aboutAllergy",
aboutTakingPils: "aboutTakingPils",
aboutSportHobbies: "aboutSportHobbies",
favoriteFoods: "favoriteFoods",
unfavoriteFoods: "unfavoriteFoods",
additionalInfo:
"additionalInfo")))); // Ensure that MyProfileModel is non-nullable
await tester.pumpWidget(
MaterialApp(
home: BlocProvider<DateOfBirthBloc>.value(
value: myProfileBloc,
child: DateOfBirthScreen(),
),
),
);
});
});
}

View File

@@ -0,0 +1,54 @@
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:eatvio_app/presentation/registration/favorite_foods_screen/favorite_foods_screen.dart';
import 'package:eatvio_app/presentation/registration/favorite_foods_screen/bloc/favorite_foods_bloc.dart';
import 'package:eatvio_app/presentation/registration/favorite_foods_screen/models/favorite_foods_model.dart';
void main() {
group('AdditionalInfoScreen', () {
testWidgets('renders screen in initial state', (WidgetTester tester) async {
final myProfileBloc = FavoriteFoodsBloc(FavoriteFoodsState(
favoriteFoodsModelObj: FavoriteFoodsModel(
userRegistrationSheet: UserRegistrationSheet(
name: "name",
firstName: "firstName",
lastName: "lastName",
email: "email",
password: "password",
passwordConfirmation: "passwordConfirmation",
termsAccepted: "termsAccepted",
birthdate: "birthdate",
gender: "gender",
country: "country",
city: "city",
lang: "lang",
weight: "weight",
height: "height",
chestCircumference: 'asdasd',
waistCircumference: "waistCircumference",
hipCircumference: "hipCircumference",
bloodPressureUp: "bloodPressureUp",
bloodPressureDown: "bloodPressureDown",
hasHypo: "hasHypo",
hasHyper: "hasHyper",
aboutAllergy: "aboutAllergy",
aboutTakingPils: "aboutTakingPils",
aboutSportHobbies: "aboutSportHobbies",
favoriteFoods: "favoriteFoods",
unfavoriteFoods: "unfavoriteFoods",
additionalInfo:
"additionalInfo")))); // Ensure that MyProfileModel is non-nullable
await tester.pumpWidget(
MaterialApp(
home: BlocProvider<FavoriteFoodsBloc>.value(
value: myProfileBloc,
child: FavoriteFoodsScreen(),
),
),
);
});
});
}