fix tests
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user