forked from eatvio/eatvio_app
feat(video_calls): added new incomng push impl, fixed mic and video sharing while connecting to call
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
import 'package:eatvio_app/features/video_calls/services/video_call_push_payload.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
group('VideoCallPushPayload', () {
|
||||
test('parses video_call type with conversation uuid', () {
|
||||
final payload = VideoCallPushPayload.tryParse({
|
||||
'type': 'video_call_incoming',
|
||||
'conversation_uuid': 'abc-123',
|
||||
'caller_name': 'Anna',
|
||||
'avatar': 'https://cdn.example/avatar.jpg',
|
||||
});
|
||||
|
||||
expect(payload, isNotNull);
|
||||
expect(payload!.conversationUuid, 'abc-123');
|
||||
expect(payload.counterpartName, 'Anna');
|
||||
expect(payload.counterpartAvatarUrl, 'https://cdn.example/avatar.jpg');
|
||||
});
|
||||
|
||||
test('parses action_url with video-call path', () {
|
||||
final payload = VideoCallPushPayload.tryParse({
|
||||
'action_url': 'https://eatvio.ru/video-call-screen?uuid=room-42',
|
||||
'counterpartName': 'Ivan',
|
||||
});
|
||||
|
||||
expect(payload, isNotNull);
|
||||
expect(payload!.conversationUuid, 'room-42');
|
||||
expect(payload.counterpartName, 'Ivan');
|
||||
});
|
||||
|
||||
test('ignores ended video call push', () {
|
||||
expect(
|
||||
VideoCallPushPayload.tryParse({
|
||||
'type': 'video_call_ended',
|
||||
'conversation_uuid': 'abc-123',
|
||||
}),
|
||||
isNull,
|
||||
);
|
||||
});
|
||||
|
||||
test('ignores regular chat push', () {
|
||||
expect(
|
||||
VideoCallPushPayload.tryParse({
|
||||
'type': 'chat_message',
|
||||
'action_url': 'https://eatvio.ru/chat/123',
|
||||
}),
|
||||
isNull,
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user