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:
@@ -138,3 +138,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -73,3 +73,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -87,3 +87,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -36,3 +36,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -62,3 +62,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -32,3 +32,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -29,3 +29,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -33,3 +33,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -112,3 +112,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -36,3 +36,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -30,3 +30,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -66,3 +66,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -118,3 +118,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -55,3 +55,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -137,3 +137,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -98,3 +98,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -166,3 +166,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -59,3 +59,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -44,3 +44,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -98,3 +98,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -78,3 +78,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -67,3 +67,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import '../../fixtures/doubles/create_diet_doubles.dart';
|
||||
import '../../fixtures/doubles/profile_doubles.dart';
|
||||
|
||||
void main() {
|
||||
group('Diet Creation Basic Widget Tests', () {
|
||||
|
||||
@@ -73,3 +73,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -82,3 +82,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -60,3 +60,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -55,3 +55,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -92,3 +92,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -44,3 +44,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -110,3 +110,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -140,3 +140,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -52,3 +52,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -60,3 +60,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -53,3 +53,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1030,3 +1030,5 @@ void main() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -62,3 +62,5 @@ void main() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
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