forked from eatvio/eatvio_app
feat(video_calls): continous ringing on a defferent device fix
This commit is contained in:
@@ -52,6 +52,7 @@ void main() {
|
||||
videoCallRepository: mockRepository,
|
||||
foregroundCoordinator: foreground,
|
||||
lifecycleBinding: lifecycleBinding,
|
||||
resolveHwId: () async => 'test-hw-id-android-01',
|
||||
);
|
||||
mockRoom = MockRoom();
|
||||
when(mockRoom.connectionState).thenReturn(lk.ConnectionState.connected);
|
||||
@@ -94,6 +95,13 @@ void main() {
|
||||
await manager.declineIncomingCall('test-uuid');
|
||||
|
||||
verifyNever(mockRepository.notifyCallEnded(any));
|
||||
verifyNever(
|
||||
mockRepository.notifyCallDeclined(
|
||||
conversationUuid: anyNamed('conversationUuid'),
|
||||
hwId: anyNamed('hwId'),
|
||||
callId: anyNamed('callId'),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -112,15 +120,34 @@ void main() {
|
||||
);
|
||||
|
||||
test(
|
||||
'decline of a call that was never joined notifies the backend',
|
||||
'decline of a call that was never joined notifies the backend via /decline',
|
||||
() async {
|
||||
when(
|
||||
mockRepository.notifyCallEnded(any),
|
||||
).thenAnswer((_) async => const VideoCallEndedResponse(sent: true));
|
||||
mockRepository.notifyCallDeclined(
|
||||
conversationUuid: anyNamed('conversationUuid'),
|
||||
hwId: anyNamed('hwId'),
|
||||
callId: anyNamed('callId'),
|
||||
),
|
||||
).thenAnswer(
|
||||
(_) async => const VideoCallDeclineResponse(
|
||||
sent: true,
|
||||
devicesNotified: 1,
|
||||
),
|
||||
);
|
||||
|
||||
await manager.declineIncomingCall('other-uuid');
|
||||
await manager.declineIncomingCall(
|
||||
'other-uuid',
|
||||
callId: 'call-uuid-1',
|
||||
);
|
||||
|
||||
verify(mockRepository.notifyCallEnded('other-uuid')).called(1);
|
||||
verify(
|
||||
mockRepository.notifyCallDeclined(
|
||||
conversationUuid: 'other-uuid',
|
||||
hwId: 'test-hw-id-android-01',
|
||||
callId: 'call-uuid-1',
|
||||
),
|
||||
).called(1);
|
||||
verifyNever(mockRepository.notifyCallEnded(any));
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user