forked from eatvio/eatvio_app
feat(video_calls): ios mic fix, android call fix. feat(dev_tools): base url caching
This commit is contained in:
@@ -124,6 +124,36 @@ void main() {
|
||||
},
|
||||
);
|
||||
|
||||
test('force end from the other participant closes the call', () async {
|
||||
when(mockManager.callEndedNotified).thenReturn(false);
|
||||
when(mockManager.endCall()).thenAnswer((_) async {});
|
||||
cubit.emit(
|
||||
const VideoCallSessionState(
|
||||
conversationUuid: 'uuid',
|
||||
connectPhase: VideoCallConnectPhase.connected,
|
||||
callStageEntered: true,
|
||||
uiMode: VideoCallUiMode.fullscreen,
|
||||
),
|
||||
);
|
||||
|
||||
managerListener(
|
||||
const VideoCallManagerSnapshot(
|
||||
conversationUuid: 'uuid',
|
||||
micEnabled: true,
|
||||
videoEnabled: true,
|
||||
connectPhase: VideoCallConnectPhase.connected,
|
||||
linkIssue: VideoCallLinkIssue.none,
|
||||
forceEndCall: true,
|
||||
),
|
||||
);
|
||||
await Future<void>.delayed(Duration.zero);
|
||||
|
||||
verify(mockManager.endCall()).called(1);
|
||||
expect(cubit.state.connectPhase, VideoCallConnectPhase.idle);
|
||||
expect(cubit.state.callStageEntered, isFalse);
|
||||
expect(cubit.state.uiMode, VideoCallUiMode.hidden);
|
||||
});
|
||||
|
||||
test('isMicActiveForUi mirrors micEnabled', () {
|
||||
const state = VideoCallSessionState(micEnabled: true);
|
||||
expect(state.isMicActiveForUi, isTrue);
|
||||
|
||||
@@ -20,9 +20,12 @@ void main() {
|
||||
final resumed = await coordinator.reactivate();
|
||||
expect(resumed, isTrue);
|
||||
|
||||
await coordinator.restartCapture();
|
||||
expect(coordinator.isActive, isTrue);
|
||||
|
||||
await coordinator.stop();
|
||||
expect(coordinator.isActive, isFalse);
|
||||
expect(calls, ['activate', 'activate', 'deactivate']);
|
||||
expect(calls, ['activate', 'activate', 'restart', 'deactivate']);
|
||||
});
|
||||
|
||||
test('stop clears the active session when deactivate fails', () async {
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
import 'package:eatvio_app/features/video_calls/services/video_call_peer_departure.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:livekit_client/livekit_client.dart' as lk;
|
||||
|
||||
void main() {
|
||||
test('ends the call when the other user leaves the room', () {
|
||||
expect(
|
||||
shouldForceEndCallAfterPeerLeft(
|
||||
callStageEntered: true,
|
||||
sessionConnected: true,
|
||||
remoteIdentities: const [],
|
||||
),
|
||||
isTrue,
|
||||
);
|
||||
});
|
||||
|
||||
test('keeps the call when another user is still in the room', () {
|
||||
expect(
|
||||
shouldForceEndCallAfterPeerLeft(
|
||||
callStageEntered: true,
|
||||
sessionConnected: true,
|
||||
remoteIdentities: const ['user-7', 'EG_recorder'],
|
||||
),
|
||||
isFalse,
|
||||
);
|
||||
});
|
||||
|
||||
test('ignores an egress bot after the other user has left', () {
|
||||
expect(
|
||||
shouldForceEndCallAfterPeerLeft(
|
||||
callStageEntered: true,
|
||||
sessionConnected: true,
|
||||
remoteIdentities: const ['EG_recorder'],
|
||||
),
|
||||
isTrue,
|
||||
);
|
||||
});
|
||||
|
||||
test('does not end a call that has not entered the stage', () {
|
||||
expect(
|
||||
shouldForceEndCallAfterPeerLeft(
|
||||
callStageEntered: false,
|
||||
sessionConnected: true,
|
||||
remoteIdentities: const [],
|
||||
),
|
||||
isFalse,
|
||||
);
|
||||
});
|
||||
|
||||
test('ends the call when the server removes this participant', () {
|
||||
expect(
|
||||
shouldForceEndCallAfterRoomDisconnect(
|
||||
callStageEntered: true,
|
||||
sessionConnected: true,
|
||||
reason: lk.DisconnectReason.participantRemoved,
|
||||
),
|
||||
isTrue,
|
||||
);
|
||||
expect(
|
||||
shouldForceEndCallAfterRoomDisconnect(
|
||||
callStageEntered: true,
|
||||
sessionConnected: true,
|
||||
reason: lk.DisconnectReason.roomDeleted,
|
||||
),
|
||||
isTrue,
|
||||
);
|
||||
});
|
||||
|
||||
test('keeps a connection-loss screen when the link drops', () {
|
||||
expect(
|
||||
shouldForceEndCallAfterRoomDisconnect(
|
||||
callStageEntered: true,
|
||||
sessionConnected: true,
|
||||
reason: lk.DisconnectReason.disconnected,
|
||||
),
|
||||
isFalse,
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -57,6 +57,7 @@ void main() {
|
||||
});
|
||||
|
||||
expect(payload, isNotNull);
|
||||
expect(payload!.conversationUuid, 'abc-123');
|
||||
});
|
||||
|
||||
test('parses message id for a stable CallKit uuid', () {
|
||||
|
||||
Reference in New Issue
Block a user