Files
eatvio_app_old/test/date_of_birth_test.dart
2024-07-11 18:30:21 +03:00

55 lines
2.3 KiB
Dart

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(),
),
),
);
});
});
}