test(registration): Pressure and circ screen test passed

This commit is contained in:
2024-03-12 17:03:23 +03:00
parent 64ade028d9
commit 9ada1d3833
2 changed files with 108 additions and 0 deletions

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/blood_pressure_screen/blood_pressure_screen.dart';
import 'package:eatvio_app/presentation/registration/blood_pressure_screen/bloc/blood_pressure_bloc.dart';
import 'package:eatvio_app/presentation/registration/blood_pressure_screen/models/blood_pressure_model.dart';
void main() {
group('AdditionalInfoScreen', () {
testWidgets('renders screen in initial state', (WidgetTester tester) async {
final myProfileBloc = BloodPressureBloc(BloodPressureState(
bloodPressureModelObj: BloodPressureModel(
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<BloodPressureBloc>.value(
value: myProfileBloc,
child: BloodPressureScreen(),
),
),
);
});
});
}

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/body_circumferences_screen/body_circumferences_screen.dart';
import 'package:eatvio_app/presentation/registration/body_circumferences_screen/bloc/body_circumferences_bloc.dart';
import 'package:eatvio_app/presentation/registration/body_circumferences_screen/models/body_circumferences_model.dart';
void main() {
group('AdditionalInfoScreen', () {
testWidgets('renders screen in initial state', (WidgetTester tester) async {
final myProfileBloc = BodyCircumferencesBloc(BodyCircumferencesState(
bodyCircumferencesModelObj: BodyCircumferencesModel(
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<BodyCircumferencesBloc>.value(
value: myProfileBloc,
child: BodyCircumferencesScreen(),
),
),
);
});
});
}