forked from eatvio/eatvio_app
feat(video_calls): ios voip push, mix and crushes fix
This commit is contained in:
@@ -479,6 +479,39 @@ void main() {
|
||||
},
|
||||
);
|
||||
|
||||
test(
|
||||
'_handleNewMessageViaSocket - завершение видеозвонка закрывает только этот чат',
|
||||
() async {
|
||||
const chatId = 'chat-id';
|
||||
final dismissed = <String?>[];
|
||||
chatsCubit.dismissIncomingVideoCall = (uuid) async {
|
||||
dismissed.add(uuid);
|
||||
};
|
||||
chatsCubit.emit(
|
||||
ChatsState(
|
||||
state: BaseState.success,
|
||||
chatRooms: [buildChatRoom(chatId)],
|
||||
),
|
||||
);
|
||||
when(mockWsManager.userId).thenReturn(42);
|
||||
|
||||
final controller = await connectToSocketStream();
|
||||
controller.add(
|
||||
socketEvent(
|
||||
id: 502,
|
||||
authorId: 7,
|
||||
roomId: chatId,
|
||||
data: 'Анна завершил(а) видеозвонок.',
|
||||
),
|
||||
);
|
||||
await Future.delayed(const Duration(milliseconds: 100));
|
||||
|
||||
expect(dismissed, [chatId]);
|
||||
|
||||
await controller.close();
|
||||
},
|
||||
);
|
||||
|
||||
test('close - закрывает cubit и отписывается от подписок', () async {
|
||||
final mockSubscription1 = MockStreamSubscription();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user