feat(registration): refactor
This commit is contained in:
@@ -1,54 +0,0 @@
|
||||
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/additional_information_screen/additional_information_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/additional_information_screen/bloc/additional_information_bloc.dart';
|
||||
import 'package:eatvio_app/presentation/registration/additional_information_screen/models/additional_information_model.dart';
|
||||
|
||||
void main() {
|
||||
group('AdditionalInfoScreen', () {
|
||||
testWidgets('renders screen in initial state', (WidgetTester tester) async {
|
||||
final myProfileBloc = AdditionalInformationBloc(AdditionalInformationState(
|
||||
additionalInformationModelObj: AdditionalInformationModel(
|
||||
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<AdditionalInformationBloc>.value(
|
||||
value: myProfileBloc,
|
||||
child: Scaffold(body: AdditionalInformationScreen()),
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
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/allergies_screen/allergies_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/allergies_screen/bloc/allergies_bloc.dart';
|
||||
import 'package:eatvio_app/presentation/registration/allergies_screen/models/allergies_model.dart';
|
||||
|
||||
void main() {
|
||||
group('AdditionalInfoScreen', () {
|
||||
testWidgets('renders screen in initial state', (WidgetTester tester) async {
|
||||
final myProfileBloc = AllergiesBloc(AllergiesState(
|
||||
allergiesModelObj: AllergiesModel(
|
||||
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<AllergiesBloc>.value(
|
||||
value: myProfileBloc,
|
||||
child: Scaffold(body: AllergiesScreen()),
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
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: Scaffold(body: BloodPressureScreen()),
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
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: Scaffold(body: BodyCircumferencesScreen()),
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
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/city_of_living_screen/city_of_living_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/city_of_living_screen/bloc/city_of_living_bloc.dart';
|
||||
import 'package:eatvio_app/presentation/registration/city_of_living_screen/models/city_of_living_model.dart';
|
||||
|
||||
void main() {
|
||||
group('AdditionalInfoScreen', () {
|
||||
testWidgets('renders screen in initial state', (WidgetTester tester) async {
|
||||
final myProfileBloc = CityOfLivingBloc(CityOfLivingState(
|
||||
cityOfLivingModelObj: CityOfLivingModel(
|
||||
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<CityOfLivingBloc>.value(
|
||||
value: myProfileBloc,
|
||||
child: Scaffold(body: CityOfLivingScreen()),
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
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/credentials_screen/credentials_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/credentials_screen/bloc/credentials_bloc.dart';
|
||||
import 'package:eatvio_app/presentation/registration/credentials_screen/models/credentials_model.dart';
|
||||
|
||||
void main() {
|
||||
group('AdditionalInfoScreen', () {
|
||||
testWidgets('renders screen in initial state', (WidgetTester tester) async {
|
||||
final myProfileBloc = CredentialsBloc(CredentialsState(
|
||||
credentialsModelObj: CredentialsModel(
|
||||
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<CredentialsBloc>.value(
|
||||
value: myProfileBloc,
|
||||
child: Scaffold(body: CredentialsScreen()),
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
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: Scaffold(body: DateOfBirthScreen()),
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:eatvio_app/presentation/diary/diary_edit_screen/diary_edit_screen.dart';
|
||||
import 'package:eatvio_app/presentation/diary/diary_edit_screen/bloc/diary_edit_bloc.dart';
|
||||
import 'package:eatvio_app/presentation/diary/diary_edit_screen/models/diary_edit_model.dart';
|
||||
|
||||
void main() {
|
||||
group('DiaryEditScreen', () {
|
||||
/*testWidgets('renders CircularProgressIndicator when in initial state',
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: DiaryEditScreen(),
|
||||
),
|
||||
);
|
||||
});*/
|
||||
|
||||
testWidgets('renders _buildDiaryEditScreen when in loaded state', (WidgetTester tester) async {
|
||||
final diaryEditBloc = DiaryEditBloc(DiaryEditState(diaryEditModelObj: DiaryEditModel()));
|
||||
final loadedState = DiaryEditLoadedState(
|
||||
diaryId: 1,
|
||||
selectedSatiety: 4,
|
||||
autocompleteList: [],
|
||||
photos: [],
|
||||
portions: [],
|
||||
wakeupExpanded: false,
|
||||
moderationExpanded: false,
|
||||
recommendedChartValues: [10, 10, 10, 10],
|
||||
consumedChartValues: [1, 2, 3, 4],
|
||||
moodExpanded: false,);
|
||||
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: BlocProvider<DiaryEditBloc>.value(
|
||||
value: diaryEditBloc,
|
||||
child: DiaryEditScreen(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
diaryEditBloc.emit(loadedState);
|
||||
await tester.pump();
|
||||
|
||||
//expect(find.byType(_buildDiaryEditScreen), findsOneWidget);
|
||||
});
|
||||
|
||||
/*testWidgets('renders error message when in error state',
|
||||
(WidgetTester tester) async {
|
||||
final diaryEditBloc =
|
||||
DiaryEditBloc(DiaryEditState(diaryEditModelObj: DiaryEditModel()));
|
||||
final errorState = DiaryEditErrorState("error");
|
||||
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: BlocProvider<DiaryEditBloc>.value(
|
||||
value: diaryEditBloc,
|
||||
child: DiaryEditScreen(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
diaryEditBloc.emit(errorState);
|
||||
await tester.pump();
|
||||
|
||||
expect(find.text('Ошибка'), findsOneWidget);
|
||||
});*/
|
||||
|
||||
// Add more tests for other scenarios if needed
|
||||
});
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
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: Scaffold(body: FavoriteFoodsScreen()),
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
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_sports_screen/favorite_sports_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/favorite_sports_screen/bloc/favorite_sports_bloc.dart';
|
||||
import 'package:eatvio_app/presentation/registration/favorite_sports_screen/models/favorite_sports_model.dart';
|
||||
|
||||
void main() {
|
||||
group('AdditionalInfoScreen', () {
|
||||
testWidgets('renders screen in initial state', (WidgetTester tester) async {
|
||||
final myProfileBloc = FavoriteSportsBloc(FavoriteSportsState(
|
||||
favoriteSportsModelObj: FavoriteSportsModel(
|
||||
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: "favoriteSports",
|
||||
unfavoriteFoods: "unfavoriteSports",
|
||||
additionalInfo:
|
||||
"additionalInfo",),),),); // Ensure that MyProfileModel is non-nullable
|
||||
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: BlocProvider<FavoriteSportsBloc>.value(
|
||||
value: myProfileBloc,
|
||||
child: Scaffold(body: FavoriteSportsScreen()),
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
//sports
|
||||
@@ -1,55 +0,0 @@
|
||||
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/gender_screen/gender_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/gender_screen/bloc/gender_bloc.dart';
|
||||
import 'package:eatvio_app/presentation/registration/gender_screen/models/gender_model.dart';
|
||||
|
||||
void main() {
|
||||
group('AdditionalInfoScreen', () {
|
||||
testWidgets('renders screen in initial state', (WidgetTester tester) async {
|
||||
final myProfileBloc = GenderBloc(GenderState(
|
||||
genderModelObj: GenderModel(
|
||||
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: "favoriteSports",
|
||||
unfavoriteFoods: "unfavoriteSports",
|
||||
additionalInfo:
|
||||
"additionalInfo",),),),); // Ensure that MyProfileModel is non-nullable
|
||||
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: BlocProvider<GenderBloc>.value(
|
||||
value: myProfileBloc,
|
||||
child: Scaffold(body: GenderScreen()),
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
//sports
|
||||
@@ -1,55 +0,0 @@
|
||||
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/height_screen/height_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/height_screen/bloc/height_bloc.dart';
|
||||
import 'package:eatvio_app/presentation/registration/height_screen/models/height_model.dart';
|
||||
|
||||
void main() {
|
||||
group('AdditionalInfoScreen', () {
|
||||
testWidgets('renders screen in initial state', (WidgetTester tester) async {
|
||||
final myProfileBloc = HeightBloc(HeightState(
|
||||
heightModelObj: HeightModel(
|
||||
userRegistrationSheet: UserRegistrationSheet(
|
||||
name: "name",
|
||||
firstName: "firstName",
|
||||
lastName: "lastName",
|
||||
email: "email",
|
||||
password: "password",
|
||||
passwordConfirmation: "passwordConfirmation",
|
||||
termsAccepted: "termsAccepted",
|
||||
birthdate: "birthdate",
|
||||
height: "height",
|
||||
country: "country",
|
||||
city: "city",
|
||||
lang: "lang",
|
||||
weight: "weight",
|
||||
gender: "height",
|
||||
chestCircumference: 'asdasd',
|
||||
waistCircumference: "waistCircumference",
|
||||
hipCircumference: "hipCircumference",
|
||||
bloodPressureUp: "bloodPressureUp",
|
||||
bloodPressureDown: "bloodPressureDown",
|
||||
hasHypo: "hasHypo",
|
||||
hasHyper: "hasHyper",
|
||||
aboutAllergy: "aboutAllergy",
|
||||
aboutTakingPils: "aboutTakingPils",
|
||||
aboutSportHobbies: "aboutSportHobbies",
|
||||
favoriteFoods: "favoriteSports",
|
||||
unfavoriteFoods: "unfavoriteSports",
|
||||
additionalInfo:
|
||||
"additionalInfo",),),),); // Ensure that MyProfileModel is non-nullable
|
||||
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: BlocProvider<HeightBloc>.value(
|
||||
value: myProfileBloc,
|
||||
child: Scaffold(body: HeightScreen()),
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
//sports
|
||||
@@ -1,26 +0,0 @@
|
||||
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/language_select_screen/language_select_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/language_select_screen/bloc/language_select_bloc.dart';
|
||||
import 'package:eatvio_app/presentation/registration/language_select_screen/models/language_select_model.dart';
|
||||
|
||||
void main() {
|
||||
group('AdditionalInfoScreen', () {
|
||||
testWidgets('renders screen in initial state', (WidgetTester tester) async {
|
||||
final myProfileBloc = LanguageSelectBloc(LanguageSelectState(
|
||||
languageSelectModelObj:
|
||||
LanguageSelectModel(),),); // Ensure that MyProfileModel is non-nullable
|
||||
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: BlocProvider<LanguageSelectBloc>.value(
|
||||
value: myProfileBloc,
|
||||
child: Scaffold(body: LanguageSelectScreen()),
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
//sports
|
||||
@@ -1,15 +0,0 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:eatvio_app/main.dart' as app;
|
||||
|
||||
void main() {
|
||||
testWidgets('Smoke test', (WidgetTester tester) async {
|
||||
// Запустить приложение
|
||||
app.main();
|
||||
|
||||
// Подождать, пока приложение загрузится
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
// Проверить, что нет ошибок
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
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/medicine_intake_screen/medicine_intake_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/medicine_intake_screen/bloc/medicine_intake_bloc.dart';
|
||||
import 'package:eatvio_app/presentation/registration/medicine_intake_screen/models/medicine_intake_model.dart';
|
||||
|
||||
void main() {
|
||||
group('AdditionalInfoScreen', () {
|
||||
testWidgets('renders screen in initial state', (WidgetTester tester) async {
|
||||
final myProfileBloc = MedicineIntakeBloc(MedicineIntakeState(
|
||||
medicineIntakeModelObj: MedicineIntakeModel(
|
||||
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<MedicineIntakeBloc>.value(
|
||||
value: myProfileBloc,
|
||||
child: Scaffold(body: MedicineIntakeScreen()),
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
//sports
|
||||
@@ -1,55 +0,0 @@
|
||||
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/name_screen/name_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/name_screen/bloc/name_bloc.dart';
|
||||
import 'package:eatvio_app/presentation/registration/name_screen/models/name_model.dart';
|
||||
|
||||
void main() {
|
||||
group('AdditionalInfoScreen', () {
|
||||
testWidgets('renders screen in initial state', (WidgetTester tester) async {
|
||||
final myProfileBloc = NameBloc(NameState(
|
||||
nameModelObj: NameModel(
|
||||
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<NameBloc>.value(
|
||||
value: myProfileBloc,
|
||||
child: Scaffold(body: NameScreen()),
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
//sports
|
||||
@@ -1,26 +0,0 @@
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:eatvio_app/presentation/profile/my_profile_screen/my_profile_screen.dart';
|
||||
import 'package:eatvio_app/presentation/profile/my_profile_screen/bloc/my_profile_bloc.dart';
|
||||
import 'package:eatvio_app/presentation/profile/my_profile_screen/models/my_profile_model.dart';
|
||||
|
||||
void main() {
|
||||
group('MyProfileScreen', () {
|
||||
testWidgets('renders CircularProgressIndicator in initial state',
|
||||
(WidgetTester tester) async {
|
||||
final myProfileBloc = MyProfileBloc(MyProfileState(
|
||||
myProfileModelObj:
|
||||
MyProfileModel(),),); // Ensure that MyProfileModel is non-nullable
|
||||
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: BlocProvider<MyProfileBloc>.value(
|
||||
value: myProfileBloc,
|
||||
child: MyProfileScreen(),
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:eatvio_app/presentation/profile/my_profile_screen/my_settings_screen.dart';
|
||||
import 'package:eatvio_app/presentation/profile/my_profile_screen/bloc/my_profile_bloc.dart';
|
||||
import 'package:eatvio_app/presentation/profile/my_profile_screen/models/my_profile_model.dart';
|
||||
|
||||
void main() {
|
||||
group('MyProfileScreen', () {
|
||||
testWidgets('renders CircularProgressIndicator in initial state',
|
||||
(WidgetTester tester) async {
|
||||
final myProfileBloc = MyProfileBloc(MyProfileState(
|
||||
myProfileModelObj:
|
||||
MyProfileModel(),),); // Ensure that MyProfileModel is non-nullable
|
||||
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: BlocProvider<MyProfileBloc>.value(
|
||||
value: myProfileBloc,
|
||||
child: Scaffold(body: MySettingsScreen()),
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
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/weight_screen/weight_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/weight_screen/bloc/weight_bloc.dart';
|
||||
import 'package:eatvio_app/presentation/registration/weight_screen/models/weight_model.dart';
|
||||
|
||||
void main() {
|
||||
group('AdditionalInfoScreen', () {
|
||||
testWidgets('renders screen in initial state', (WidgetTester tester) async {
|
||||
final myProfileBloc = WeightBloc(WeightState(
|
||||
weightModelObj: WeightModel(
|
||||
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<WeightBloc>.value(
|
||||
value: myProfileBloc,
|
||||
child: Scaffold(body: WeightScreen()),
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
//sports
|
||||
Reference in New Issue
Block a user