forked from eatvio/eatvio_app
test(registration): More test passed
This commit is contained in:
55
test/favorite_sports_test.dart
Normal file
55
test/favorite_sports_test.dart
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
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: FavoriteSportsScreen(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//sports
|
||||||
55
test/gender_test.dart
Normal file
55
test/gender_test.dart
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
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: GenderScreen(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//sports
|
||||||
55
test/height_test.dart
Normal file
55
test/height_test.dart
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
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: HeightScreen(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//sports
|
||||||
27
test/language_select_test.dart
Normal file
27
test/language_select_test.dart
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
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/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: LanguageSelectScreen(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//sports
|
||||||
Reference in New Issue
Block a user