forked from eatvio/eatvio_app
feat(tests): test coverage is 70.5
This commit is contained in:
@@ -82,5 +82,35 @@ void main() {
|
||||
// Проверяем, что есть хотя бы один маршрут
|
||||
expect(routes.length, greaterThan(0));
|
||||
});
|
||||
|
||||
test('appRouter имеет правильную конфигурацию', () {
|
||||
expect(AppRouter.appRouter.configuration, isNotNull);
|
||||
expect(AppRouter.appRouter.configuration.routes, isNotEmpty);
|
||||
});
|
||||
|
||||
test('navigateToRegisterViaSocial создает правильную структуру extra', () {
|
||||
const authResult = AuthResultEntity(
|
||||
accessToken: 'test_token',
|
||||
refreshToken: 'refresh_token',
|
||||
userId: '1',
|
||||
clientId: 'test_client_id',
|
||||
);
|
||||
const provider = 'yandex';
|
||||
|
||||
expect(() => AppRouter.navigateToRegisterViaSocial(authResult: authResult, provider: provider), returnsNormally);
|
||||
});
|
||||
|
||||
test('navigateToRegisterViaSocial работает с разными провайдерами', () {
|
||||
const authResult = AuthResultEntity(
|
||||
accessToken: 'test_token',
|
||||
refreshToken: 'refresh_token',
|
||||
userId: '1',
|
||||
clientId: 'test_client_id',
|
||||
);
|
||||
|
||||
expect(() => AppRouter.navigateToRegisterViaSocial(authResult: authResult, provider: 'yandex'), returnsNormally);
|
||||
expect(() => AppRouter.navigateToRegisterViaSocial(authResult: authResult, provider: 'vk'), returnsNormally);
|
||||
expect(() => AppRouter.navigateToRegisterViaSocial(authResult: authResult, provider: 'google'), returnsNormally);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user