forked from eatvio/eatvio_app
feat(registration): added email verification, feat(diary): fixed moderation request, feat(oauth): fixed email and phone verification
This commit is contained in:
14
test/fixtures/doubles/auth_doubles.dart
vendored
14
test/fixtures/doubles/auth_doubles.dart
vendored
@@ -3,20 +3,18 @@ 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';
|
||||
|
||||
/// Fixture-based replacement for [AuthRepository].
|
||||
///
|
||||
/// - Records every credential payload that would be sent to the backend.
|
||||
/// - Returns data loaded from fixture files so QA/backenders can see
|
||||
/// exactly what is exchanged.
|
||||
class FixtureAuthRepository extends AuthRepository {
|
||||
FixtureAuthRepository({
|
||||
required this.tokenFixture,
|
||||
}) : super(authService: _NoopAuthService());
|
||||
FixtureAuthRepository({required this.tokenFixture}) : super(authService: _NoopAuthService());
|
||||
|
||||
final TokenModel tokenFixture;
|
||||
|
||||
@@ -45,10 +43,7 @@ class CredentialsCall {
|
||||
final String email;
|
||||
final String password;
|
||||
|
||||
Map<String, String> toJson() => <String, String>{
|
||||
'email': email,
|
||||
'password': password,
|
||||
};
|
||||
Map<String, String> toJson() => <String, String>{'email': email, 'password': password};
|
||||
}
|
||||
|
||||
class _NoopAuthService implements AuthService {
|
||||
@@ -68,7 +63,7 @@ class _NoopAuthService implements AuthService {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<OAuthVerificationRequestResponse> requestOAuthVerification({required OAuthVerificationRequest body}) {
|
||||
Future<OAuthVerificationRequestResponse> requestOAuthVerification({required Map<String, dynamic> body}) {
|
||||
throw UnimplementedError('Not implemented in fixture.');
|
||||
}
|
||||
|
||||
@@ -77,4 +72,3 @@ class _NoopAuthService implements AuthService {
|
||||
throw UnimplementedError('Not implemented in fixture.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user