forked from eatvio/eatvio_app
feat(tests): increased tests coverage
This commit is contained in:
@@ -29,28 +29,37 @@ void main() {
|
||||
});
|
||||
|
||||
test('navigateToRegisterViaSocial - принимает правильные параметры', () {
|
||||
const authResult = AuthResultEntity(
|
||||
accessToken: 'test_token',
|
||||
refreshToken: 'refresh_token',
|
||||
userId: '1',
|
||||
clientId: 'test_client_id',
|
||||
);
|
||||
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,
|
||||
);
|
||||
expect(() => AppRouter.navigateToRegisterViaSocial(authResult: authResult, provider: provider), returnsNormally);
|
||||
});
|
||||
|
||||
test('appRouter содержит маршруты', () {
|
||||
final routes = AppRouter.appRouter.configuration.routes;
|
||||
expect(routes, isNotEmpty);
|
||||
});
|
||||
|
||||
test('appRouter имеет правильную конфигурацию', () {
|
||||
expect(AppRouter.appRouter.configuration, isNotNull);
|
||||
expect(AppRouter.appRouter.configuration.routes, isNotEmpty);
|
||||
});
|
||||
|
||||
test('appRouter имеет redirect функцию', () {
|
||||
expect(AppRouter.appRouter.configuration.redirect, isNotNull);
|
||||
});
|
||||
|
||||
test('navigateToRegisterViaSocial вызывает pushNamed с правильными параметрами', () {
|
||||
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('appRouter configuration routes содержит маршруты разных типов', () {
|
||||
final routes = AppRouter.appRouter.configuration.routes;
|
||||
|
||||
expect(routes.length, greaterThan(0));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user