25 lines
885 B
Dart
25 lines
885 B
Dart
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:yumi/services/auth/user_profile_manager.dart';
|
|
import 'package:yumi/shared/business_logic/models/res/login_res.dart';
|
|
import 'package:yumi/shared/business_logic/models/res/room_user_card_res.dart';
|
|
|
|
void main() {
|
|
test('stale room card dispose does not clear the active card session', () {
|
|
final manager = SocialChatUserProfileManager();
|
|
final staleSession = manager.beginRoomUserCardSession();
|
|
final activeSession = manager.beginRoomUserCardSession();
|
|
|
|
manager.userCardInfo = RoomUserCardRes(
|
|
userProfile: SocialChatUserProfile(id: 'active-user'),
|
|
);
|
|
|
|
manager.clearRoomUserCard(sessionSerial: staleSession);
|
|
|
|
expect(manager.userCardInfo?.userProfile?.id, 'active-user');
|
|
|
|
manager.clearRoomUserCard(sessionSerial: activeSession);
|
|
|
|
expect(manager.userCardInfo, isNull);
|
|
});
|
|
}
|