fix tests

This commit is contained in:
Valere
2026-03-24 08:43:31 +01:00
committed by Mauro
parent 3030a9438c
commit f5451e5e17
2 changed files with 12 additions and 6 deletions

View File

@@ -9,7 +9,7 @@
import MatrixRustSDK
extension RoomProtocol {
func joinCallIntent(voiceOnly: Bool) async -> Intent {
func joinCallIntent(voiceOnly: Bool = false) async -> Intent {
switch await (hasActiveRoomCall(), isDirect()) {
case (true, true): voiceOnly ? .joinExistingDmVoice : .joinExistingDm
case (true, false): .joinExisting

View File

@@ -18,19 +18,25 @@ struct RoomTests {
room.hasActiveRoomCallReturnValue = false
room.isDirectReturnValue = false
var callIntent = await room.joinCallIntent
var callIntent = await room.joinCallIntent()
#expect(callIntent == .startCall)
room.isDirectReturnValue = true
callIntent = await room.joinCallIntent
callIntent = await room.joinCallIntent()
#expect(callIntent == .startCallDm)
callIntent = await room.joinCallIntent(voiceOnly: true)
#expect(callIntent == .startCallDmVoice)
room.hasActiveRoomCallReturnValue = true
callIntent = await room.joinCallIntent
callIntent = await room.joinCallIntent()
#expect(callIntent == .joinExistingDm)
callIntent = await room.joinCallIntent(voiceOnly: true)
#expect(callIntent == .joinExistingDmVoice)
room.isDirectReturnValue = false
callIntent = await room.joinCallIntent
callIntent = await room.joinCallIntent()
#expect(callIntent == .joinExisting)
}
}