forked from eatvio/eatvio_app
Add regression tests for avatar reset and token-change refresh, stale 401 handling, idempotent session teardown and account-scoped preference cleanup. Update existing cubit tests for the new session dependency. Refs: #1113
25 lines
556 B
Dart
25 lines
556 B
Dart
import 'package:eatvio_app/core/session/session_lifecycle_service.dart';
|
|
|
|
class FakeSessionLifecycleService implements SessionLifecycleService {
|
|
int onAuthenticatedCalls = 0;
|
|
int endSessionCalls = 0;
|
|
int logoutCalls = 0;
|
|
SessionEndReason? lastEndReason;
|
|
|
|
@override
|
|
Future<void> onAuthenticated() async {
|
|
onAuthenticatedCalls++;
|
|
}
|
|
|
|
@override
|
|
Future<void> endSession({required SessionEndReason reason}) async {
|
|
endSessionCalls++;
|
|
lastEndReason = reason;
|
|
}
|
|
|
|
@override
|
|
Future<void> logout() async {
|
|
logoutCalls++;
|
|
}
|
|
}
|