forked from eatvio/eatvio_app
test(session): cover avatar refresh and session teardown
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
This commit is contained in:
24
test/fixtures/doubles/session_doubles.dart
vendored
Normal file
24
test/fixtures/doubles/session_doubles.dart
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
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++;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user