forked from eatvio/eatvio_app
feat(auth): implement OAuth verification request and confirmation flow with error handling and UI updates
This commit is contained in:
14
test/fixtures/doubles/auth_doubles.dart
vendored
14
test/fixtures/doubles/auth_doubles.dart
vendored
@@ -1,6 +1,10 @@
|
||||
import 'package:eatvio_app/features/auth/models/credentials_model.dart';
|
||||
import 'package:eatvio_app/features/auth/models/oauth_login_request.dart';
|
||||
import 'package:eatvio_app/features/auth/models/oauth_model.dart';
|
||||
import 'package:eatvio_app/features/auth/models/oauth_verification_confirm_request.dart';
|
||||
import 'package:eatvio_app/features/auth/models/oauth_verification_confirm_response.dart';
|
||||
import 'package:eatvio_app/features/auth/models/oauth_verification_request.dart';
|
||||
import 'package:eatvio_app/features/auth/models/oauth_verification_request_response.dart';
|
||||
import 'package:eatvio_app/features/auth/models/token_model.dart';
|
||||
import 'package:eatvio_app/features/auth/repositories/auth_repository.dart';
|
||||
import 'package:eatvio_app/features/auth/services/auth_service.dart';
|
||||
@@ -62,5 +66,15 @@ class _NoopAuthService implements AuthService {
|
||||
Future<Map<String, Object?>> signUpViaSocialMedia({required OAuthModel body}) {
|
||||
throw UnimplementedError('Not implemented in fixture.');
|
||||
}
|
||||
|
||||
@override
|
||||
Future<OAuthVerificationRequestResponse> requestOAuthVerification({required OAuthVerificationRequest body}) {
|
||||
throw UnimplementedError('Not implemented in fixture.');
|
||||
}
|
||||
|
||||
@override
|
||||
Future<OAuthVerificationConfirmResponse> confirmOAuthVerification({required OAuthVerificationConfirmRequest body}) {
|
||||
throw UnimplementedError('Not implemented in fixture.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
18
test/fixtures/doubles/create_diet_doubles.dart
vendored
18
test/fixtures/doubles/create_diet_doubles.dart
vendored
@@ -7,9 +7,6 @@ import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart';
|
||||
import 'package:eatvio_app/features/glossary/models/glossary_model.dart';
|
||||
import 'package:eatvio_app/features/glossary/repositories/glossary_repository.dart';
|
||||
import 'package:eatvio_app/features/glossary/services/glossary_service.dart';
|
||||
import 'package:eatvio_app/features/profile/models/profile_model.dart';
|
||||
import 'package:eatvio_app/features/profile/repositories/profile_repository.dart';
|
||||
import 'package:eatvio_app/features/profile/services/profile_service.dart';
|
||||
import 'package:retrofit/dio.dart' show HttpResponse;
|
||||
|
||||
import '../../fixtures/fixture_reader.dart';
|
||||
@@ -133,16 +130,6 @@ class FixtureCreateDietRepository extends CreateDietRepository {
|
||||
}
|
||||
}
|
||||
|
||||
class FixtureProfileRepository extends ProfileRepository {
|
||||
FixtureProfileRepository() : super(profileService: _NoopProfileService());
|
||||
|
||||
@override
|
||||
Future<ProfileModel> getMyProfile() async {
|
||||
final profileFixture = FixtureReader.readAsMap('profile/my_profile_response.json');
|
||||
return ProfileModel.fromJson(profileFixture);
|
||||
}
|
||||
}
|
||||
|
||||
class FixtureGlossaryRepository extends GlossaryRepository {
|
||||
FixtureGlossaryRepository() : super(glossaryService: _NoopGlossaryService());
|
||||
|
||||
@@ -190,11 +177,6 @@ class _NoopCreateDietService implements CreateDietService {
|
||||
}
|
||||
}
|
||||
|
||||
class _NoopProfileService implements ProfileService {
|
||||
@override
|
||||
noSuchMethod(Invocation invocation) => throw UnimplementedError('ProfileService call ${invocation.memberName}');
|
||||
}
|
||||
|
||||
class _NoopGlossaryService implements GlossaryService {
|
||||
@override
|
||||
noSuchMethod(Invocation invocation) => throw UnimplementedError('GlossaryService call ${invocation.memberName}');
|
||||
|
||||
Reference in New Issue
Block a user