forked from eatvio/eatvio_app
test(registration): Favorite foods and birth date screen test passed
This commit is contained in:
@@ -38,7 +38,7 @@ class _FavoriteFoodsScreenState extends State<FavoriteFoodsScreen> {
|
|||||||
body: Container(
|
body: Container(
|
||||||
width: double.maxFinite,
|
width: double.maxFinite,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
|
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v),
|
||||||
child: Column(children: [
|
child: ListView(children: [
|
||||||
SizedBox(height: 7.v),
|
SizedBox(height: 7.v),
|
||||||
Container(
|
Container(
|
||||||
height: 16.v,
|
height: 16.v,
|
||||||
|
|||||||
54
test/date_of_birth_test.dart
Normal file
54
test/date_of_birth_test.dart
Normal 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(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
54
test/favorite_foods_test.dart
Normal file
54
test/favorite_foods_test.dart
Normal 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(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user