forked from eatvio/eatvio_app
feat(tests): increased tests coverage
This commit is contained in:
@@ -12,37 +12,70 @@ void main() {
|
||||
|
||||
test('createRoutes содержит маршрут welcomeScreen', () {
|
||||
final routes = OtherRoutes.createRoutes();
|
||||
final welcomeRoute = routes.firstWhere(
|
||||
(route) => route is GoRoute && route.path == '/welcome-screen',
|
||||
final welcomeRoute = routes.firstWhere((route) => route is GoRoute && route.path == '/welcome-screen', orElse: () => throw Exception('Route not found'));
|
||||
expect(welcomeRoute, isA<GoRoute>());
|
||||
});
|
||||
|
||||
test('createRoutes содержит маршрут updateScreen', () {
|
||||
final routes = OtherRoutes.createRoutes();
|
||||
final updateRoute = routes.firstWhere((route) => route is GoRoute && route.path == '/update-screen', orElse: () => throw Exception('Route not found'));
|
||||
expect(updateRoute, isA<GoRoute>());
|
||||
});
|
||||
|
||||
test('createRoutes содержит маршрут calendarScreen', () {
|
||||
final routes = OtherRoutes.createRoutes();
|
||||
final calendarRoute = routes.firstWhere(
|
||||
(route) => route is GoRoute && route.path == '/calendar-screen',
|
||||
orElse: () => throw Exception('Route not found'),
|
||||
);
|
||||
expect(welcomeRoute, isA<GoRoute>());
|
||||
expect(calendarRoute, isA<GoRoute>());
|
||||
});
|
||||
|
||||
test('createRoutes содержит маршрут supportScreen', () {
|
||||
final routes = OtherRoutes.createRoutes();
|
||||
final supportRoute = routes.firstWhere((route) => route is GoRoute && route.path == '/support-screen', orElse: () => throw Exception('Route not found'));
|
||||
expect(supportRoute, isA<GoRoute>());
|
||||
});
|
||||
|
||||
test('createRoutes содержит маршрут glossaryScreen', () {
|
||||
final routes = OtherRoutes.createRoutes();
|
||||
final glossaryRoute = routes.firstWhere(
|
||||
(route) => route is GoRoute && route.path == '/glossary-screen',
|
||||
orElse: () => throw Exception('Route not found'),
|
||||
);
|
||||
expect(glossaryRoute, isA<GoRoute>());
|
||||
});
|
||||
|
||||
test('createRoutes содержит маршрут becomeConsultantScreen', () {
|
||||
final routes = OtherRoutes.createRoutes();
|
||||
final becomeConsultantRoute = routes.firstWhere(
|
||||
(route) => route is GoRoute && route.path == '/become-consultant-screen',
|
||||
orElse: () => throw Exception('Route not found'),
|
||||
);
|
||||
expect(becomeConsultantRoute, isA<GoRoute>());
|
||||
});
|
||||
|
||||
test('createRoutes содержит маршрут createPlanScreen', () {
|
||||
final routes = OtherRoutes.createRoutes();
|
||||
final createPlanRoute = routes.firstWhere(
|
||||
(route) => route is GoRoute && route.path == '/create-plan-screen',
|
||||
orElse: () => throw Exception('Route not found'),
|
||||
);
|
||||
expect(createPlanRoute, isA<GoRoute>());
|
||||
});
|
||||
|
||||
test('createRoutes содержит маршрут с redirect функцией для welcomeScreen', () {
|
||||
final routes = OtherRoutes.createRoutes();
|
||||
final welcomeRoute =
|
||||
routes.firstWhere((route) => route is GoRoute && route.path == '/welcome-screen', orElse: () => throw Exception('Route not found')) as GoRoute;
|
||||
expect(welcomeRoute.redirect, isNotNull);
|
||||
});
|
||||
|
||||
test('createRoutes содержит маршрут с redirect функцией для updateScreen', () {
|
||||
final routes = OtherRoutes.createRoutes();
|
||||
final updateRoute =
|
||||
routes.firstWhere((route) => route is GoRoute && route.path == '/update-screen', orElse: () => throw Exception('Route not found')) as GoRoute;
|
||||
expect(updateRoute.redirect, isNotNull);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user