forked from eatvio/eatvio_app
chore(version): update app version to 1.3.5+85 and improve test coverage reporting in CI
This commit is contained in:
30
test/core/routing/auth_routes_test.dart
Normal file
30
test/core/routing/auth_routes_test.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
import 'package:eatvio_app/core/routing/auth_routes.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
void main() {
|
||||
group('AuthRoutes', () {
|
||||
test('createRoutes возвращает список маршрутов', () {
|
||||
final routes = AuthRoutes.createRoutes();
|
||||
expect(routes, isNotEmpty);
|
||||
expect(routes, isA<List<RouteBase>>());
|
||||
});
|
||||
|
||||
test('createRoutes содержит маршрут authScreen', () {
|
||||
final routes = AuthRoutes.createRoutes();
|
||||
final authRoute = routes.firstWhere(
|
||||
(route) => route is GoRoute && route.path == '/auth-screen',
|
||||
orElse: () => throw Exception('Route not found'),
|
||||
);
|
||||
expect(authRoute, isA<GoRoute>());
|
||||
});
|
||||
|
||||
test('createRoutes содержит вложенные маршруты', () {
|
||||
final routes = AuthRoutes.createRoutes();
|
||||
final authRoute = routes.first as GoRoute;
|
||||
expect(authRoute.routes, isNotEmpty);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
33
test/core/routing/content_routes_test.dart
Normal file
33
test/core/routing/content_routes_test.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
import 'package:eatvio_app/core/routing/content_routes.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
void main() {
|
||||
group('ContentRoutes', () {
|
||||
test('createRoutes возвращает список маршрутов', () {
|
||||
final routes = ContentRoutes.createRoutes();
|
||||
expect(routes, isNotEmpty);
|
||||
expect(routes, isA<List<RouteBase>>());
|
||||
});
|
||||
|
||||
test('createRoutes содержит маршрут aboutPlanScreen', () {
|
||||
final routes = ContentRoutes.createRoutes();
|
||||
final planRoute = routes.firstWhere(
|
||||
(route) => route is GoRoute && route.path == '/about-plan-screen',
|
||||
orElse: () => throw Exception('Route not found'),
|
||||
);
|
||||
expect(planRoute, isA<GoRoute>());
|
||||
});
|
||||
|
||||
test('createRoutes содержит маршрут aboutRecipesScreen', () {
|
||||
final routes = ContentRoutes.createRoutes();
|
||||
final recipeRoute = routes.firstWhere(
|
||||
(route) => route is GoRoute && route.path == '/about-recipes-screen',
|
||||
orElse: () => throw Exception('Route not found'),
|
||||
);
|
||||
expect(recipeRoute, isA<GoRoute>());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
20
test/core/routing/main_navigation_routes_test.dart
Normal file
20
test/core/routing/main_navigation_routes_test.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'package:eatvio_app/core/routing/main_navigation_routes.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
void main() {
|
||||
group('MainNavigationRoutes', () {
|
||||
test('createRoutes возвращает список маршрутов', () {
|
||||
final routes = MainNavigationRoutes.createRoutes();
|
||||
expect(routes, isNotEmpty);
|
||||
expect(routes, isA<List<RouteBase>>());
|
||||
});
|
||||
|
||||
test('createRoutes содержит ShellRoute', () {
|
||||
final routes = MainNavigationRoutes.createRoutes();
|
||||
expect(routes.first, isA<ShellRoute>());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
24
test/core/routing/other_routes_test.dart
Normal file
24
test/core/routing/other_routes_test.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
import 'package:eatvio_app/core/routing/other_routes.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
void main() {
|
||||
group('OtherRoutes', () {
|
||||
test('createRoutes возвращает список маршрутов', () {
|
||||
final routes = OtherRoutes.createRoutes();
|
||||
expect(routes, isNotEmpty);
|
||||
expect(routes, isA<List<RouteBase>>());
|
||||
});
|
||||
|
||||
test('createRoutes содержит маршрут welcomeScreen', () {
|
||||
final routes = OtherRoutes.createRoutes();
|
||||
final welcomeRoute = routes.firstWhere(
|
||||
(route) => route is GoRoute && route.path == '/welcome-screen',
|
||||
orElse: () => throw Exception('Route not found'),
|
||||
);
|
||||
expect(welcomeRoute, isA<GoRoute>());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
103
test/core/routing/route_constants_test.dart
Normal file
103
test/core/routing/route_constants_test.dart
Normal file
@@ -0,0 +1,103 @@
|
||||
import 'package:eatvio_app/core/routing/route_constants.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
group('RouteConstants', () {
|
||||
test('has all auth routes defined', () {
|
||||
expect(RouteConstants.authScreen, '/auth-screen');
|
||||
expect(RouteConstants.registrationScreen, 'registration-screen');
|
||||
expect(RouteConstants.registrationScreenV2, 'registration-screen-v2');
|
||||
expect(RouteConstants.forgetPasswordScreen, 'forget-password-screen');
|
||||
expect(RouteConstants.scanQRCodeScreen, 'scan-qr-code-screen');
|
||||
expect(RouteConstants.verifyScreen, '/verify-screen');
|
||||
expect(RouteConstants.verifyEmailScreen, '/verify-email-screen');
|
||||
expect(RouteConstants.registerViaSocialScreen, '/register-via-social-screen');
|
||||
});
|
||||
|
||||
test('has all main navigation routes defined', () {
|
||||
expect(RouteConstants.myProfileScreen, '/my-profile-screen');
|
||||
expect(RouteConstants.feedScreen, '/feed-screen');
|
||||
expect(RouteConstants.diaryScreen, '/diary-screen');
|
||||
expect(RouteConstants.consultationsScreen, '/consultations-screen');
|
||||
expect(RouteConstants.chatSelectScreen, '/chat-select-screen');
|
||||
expect(RouteConstants.notificationsScreen, '/notifications-screen');
|
||||
expect(RouteConstants.menuScreen, '/menu-screen');
|
||||
});
|
||||
|
||||
test('has all content routes defined', () {
|
||||
expect(RouteConstants.aboutPlanScreen, '/about-plan-screen');
|
||||
expect(RouteConstants.aboutRecipesScreen, '/about-recipes-screen');
|
||||
expect(RouteConstants.aboutDietScreen, '/about-diet-screen');
|
||||
expect(RouteConstants.blogPostScreen, '/blog-post-screen');
|
||||
expect(RouteConstants.blogPostCreateScreen, '/blog-post-create-screen');
|
||||
});
|
||||
|
||||
test('has all profile routes defined', () {
|
||||
expect(RouteConstants.profileScreen, '/profile-screen');
|
||||
expect(RouteConstants.subsScreen, '/subs-screen');
|
||||
});
|
||||
|
||||
test('has all settings routes defined', () {
|
||||
expect(RouteConstants.settingsScreen, '/settings-screen');
|
||||
expect(RouteConstants.generalInfoScreen, 'general-info-screen');
|
||||
expect(RouteConstants.otherInfoScreen, 'other-info-screen');
|
||||
expect(RouteConstants.physicalActivityScreen, 'physical-activity-screen');
|
||||
expect(RouteConstants.physicalFormScreen, 'physical-form-screen');
|
||||
expect(RouteConstants.pressureScreen, 'pressure-screen');
|
||||
expect(RouteConstants.changePasswordScreen, 'change-password-screen');
|
||||
expect(RouteConstants.changeEmailScreen, 'change-email-screen');
|
||||
});
|
||||
|
||||
test('has all consultant routes defined', () {
|
||||
expect(RouteConstants.becomeConsultantScreen, '/become-consultant-screen');
|
||||
expect(RouteConstants.stepperBecomeConsultantScreen, '/stepper-become-consultant-screen');
|
||||
expect(RouteConstants.consultantRatingScreen, '/consultant-rating-screen');
|
||||
});
|
||||
|
||||
test('has all other routes defined', () {
|
||||
expect(RouteConstants.welcomeScreen, '/welcome-screen');
|
||||
expect(RouteConstants.updateScreen, '/update-screen');
|
||||
expect(RouteConstants.calendarScreen, '/calendar-screen');
|
||||
expect(RouteConstants.supportScreen, '/support-screen');
|
||||
expect(RouteConstants.photoViewScreen, '/photo-view-screen');
|
||||
expect(RouteConstants.chatScreen, '/chat-screen');
|
||||
expect(RouteConstants.emptyChatScreen, '/empty-chat-screen');
|
||||
expect(RouteConstants.glossaryScreen, '/glossary-screen');
|
||||
expect(RouteConstants.blockedUsersScreen, '/blocked-users-screen');
|
||||
expect(RouteConstants.notificationsSettingsScreen, '/notifications-settings-screen');
|
||||
});
|
||||
|
||||
test('has all finance routes defined', () {
|
||||
expect(RouteConstants.userFinanceScreen, '/user-finance-screen');
|
||||
expect(RouteConstants.cardSettingsScreen, '/card-settings-screen');
|
||||
expect(RouteConstants.orderInfoScreen, '/order-info-screen');
|
||||
expect(RouteConstants.paymentScreen, '/payment-screen');
|
||||
});
|
||||
|
||||
test('has all content creation routes defined', () {
|
||||
expect(RouteConstants.recipeCreateScreen, '/recipe-create-screen');
|
||||
expect(RouteConstants.createDietScreen, '/create-diet-screen');
|
||||
expect(RouteConstants.dietPreviewScreen, '/diet-preview-screen');
|
||||
expect(RouteConstants.createPlanScreen, '/create-plan-screen');
|
||||
expect(RouteConstants.myDietsScreen, '/my-diets-screen');
|
||||
expect(RouteConstants.myPlansScreen, '/my-plans-screen');
|
||||
expect(RouteConstants.myRecipesScreen, '/my-recipes-screen');
|
||||
});
|
||||
|
||||
test('has all user details routes defined', () {
|
||||
expect(RouteConstants.userDetailsScreen, '/user-details-screen');
|
||||
expect(RouteConstants.userDiaryScreen, '/user-diary-screen');
|
||||
});
|
||||
|
||||
test('has dev tools route defined', () {
|
||||
expect(RouteConstants.devToolsScreen, '/dev-tools-screen');
|
||||
});
|
||||
|
||||
test('has all archive routes defined', () {
|
||||
expect(RouteConstants.consultationsArchiveScreen, '/consultations-archive-screen');
|
||||
expect(RouteConstants.consultantFinancesScreen, '/consultant-finances-screen');
|
||||
expect(RouteConstants.userPurchasesScreen, '/user-purchases-screen');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
27
test/core/routing/settings_routes_test.dart
Normal file
27
test/core/routing/settings_routes_test.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
import 'package:eatvio_app/core/routing/settings_routes.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
void main() {
|
||||
group('SettingsRoutes', () {
|
||||
test('createRoutes возвращает список маршрутов', () {
|
||||
final routes = SettingsRoutes.createRoutes();
|
||||
expect(routes, isNotEmpty);
|
||||
expect(routes, isA<List<RouteBase>>());
|
||||
});
|
||||
|
||||
test('createRoutes содержит маршрут settingsScreen', () {
|
||||
final routes = SettingsRoutes.createRoutes();
|
||||
final settingsRoute = routes.first as GoRoute;
|
||||
expect(settingsRoute.path, '/settings-screen');
|
||||
});
|
||||
|
||||
test('createRoutes содержит вложенные маршруты', () {
|
||||
final routes = SettingsRoutes.createRoutes();
|
||||
final settingsRoute = routes.first as GoRoute;
|
||||
expect(settingsRoute.routes, isNotEmpty);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user